Commit workspace changes
This commit is contained in:
@@ -60,6 +60,10 @@ export default function Step3Publish({
|
||||
timezone = null,
|
||||
visibility = 'public',
|
||||
onVisibilityChange,
|
||||
selectedGroup = null,
|
||||
currentContributorOptions = [],
|
||||
actionLabel = 'Publish now',
|
||||
showScheduleSummary = true,
|
||||
// Category tree (for label lookup)
|
||||
allRootCategoryOptions = [],
|
||||
filteredCategoryTree = [],
|
||||
@@ -79,6 +83,21 @@ export default function Step3Publish({
|
||||
) ?? null
|
||||
const subLabel = subCategory?.name ?? null
|
||||
const descriptionPreview = stripHtml(metadata.description)
|
||||
const primaryAuthor = (Array.isArray(currentContributorOptions) ? currentContributorOptions : []).find(
|
||||
(user) => Number(user.id) === Number(metadata.primaryAuthorUserId)
|
||||
) ?? null
|
||||
const contributorCredits = metadata.contributorCredits || {}
|
||||
const contributors = (Array.isArray(currentContributorOptions) ? currentContributorOptions : [])
|
||||
.filter((user) => Array.isArray(metadata.contributorUserIds) && metadata.contributorUserIds.some((id) => Number(id) === Number(user.id)))
|
||||
.map((user) => {
|
||||
const creditMeta = contributorCredits?.[user.id] || contributorCredits?.[String(user.id)] || { creditRole: '', isPrimary: false }
|
||||
|
||||
return {
|
||||
...user,
|
||||
creditRole: creditMeta.creditRole || '',
|
||||
isPrimary: Boolean(creditMeta.isPrimary),
|
||||
}
|
||||
})
|
||||
|
||||
const checks = [
|
||||
{ label: 'File uploaded', ok: uploadReady },
|
||||
@@ -151,6 +170,7 @@ export default function Step3Publish({
|
||||
<div className="flex flex-wrap gap-x-4 gap-y-1 text-xs text-white/55">
|
||||
<span>Tags: <span className="text-white/75">{(metadata.tags || []).length}</span></span>
|
||||
<span>Audience: <span className="text-white/75">{metadata.isMature ? 'Mature' : 'General'}</span></span>
|
||||
{selectedGroup ? <span>Publisher: <span className="text-white/75">{selectedGroup.name}</span></span> : <span>Publisher: <span className="text-white/75">Personal profile</span></span>}
|
||||
{!isArchive && fileMetadata?.resolution && fileMetadata.resolution !== '—' && (
|
||||
<span>Resolution: <span className="text-white/75">{fileMetadata.resolution}</span></span>
|
||||
)}
|
||||
@@ -159,6 +179,26 @@ export default function Step3Publish({
|
||||
)}
|
||||
</div>
|
||||
|
||||
{(selectedGroup || primaryAuthor || contributors.length > 0) && (
|
||||
<div className="space-y-2 text-xs text-white/55">
|
||||
{primaryAuthor ? <span>Primary author: <span className="text-white/75">{primaryAuthor.name || primaryAuthor.username}</span></span> : null}
|
||||
{contributors.length > 0 ? (
|
||||
<div>
|
||||
<span>Contributors:</span>
|
||||
<div className="mt-1 flex flex-wrap gap-2">
|
||||
{contributors.map((user) => (
|
||||
<span key={user.id} className="inline-flex items-center gap-2 rounded-full border border-white/10 bg-white/[0.04] px-3 py-1.5 text-white/80">
|
||||
<span>{user.name || user.username}</span>
|
||||
{user.creditRole ? <span className="text-white/50">{user.creditRole}</span> : null}
|
||||
{user.isPrimary ? <span className="rounded-full border border-emerald-300/30 bg-emerald-400/12 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-[0.16em] text-emerald-100">Lead support</span> : null}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{descriptionPreview && (
|
||||
<p className="line-clamp-2 text-xs text-white/50">{descriptionPreview}</p>
|
||||
)}
|
||||
@@ -221,7 +261,7 @@ export default function Step3Publish({
|
||||
<span className="inline-flex items-center gap-1.5 rounded-full border border-white/15 bg-white/6 px-2.5 py-1 text-xs text-white/60">
|
||||
👁 {visibility === 'public' ? 'Public' : visibility === 'unlisted' ? 'Unlisted' : 'Private'}
|
||||
</span>
|
||||
{publishMode === 'schedule' && scheduledAt ? (
|
||||
{showScheduleSummary && publishMode === 'schedule' && scheduledAt ? (
|
||||
<span className="inline-flex items-center gap-1.5 rounded-full border border-violet-300/30 bg-violet-500/15 px-2.5 py-1 text-xs text-violet-200">
|
||||
🕐 Scheduled
|
||||
{timezone && (
|
||||
@@ -237,7 +277,7 @@ export default function Step3Publish({
|
||||
</span>
|
||||
) : (
|
||||
<span className="inline-flex items-center gap-1.5 rounded-full border border-emerald-300/30 bg-emerald-500/12 px-2.5 py-1 text-xs text-emerald-200">
|
||||
⚡ Publish immediately
|
||||
⚡ {actionLabel}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user