+
+
+ Voiceover scripts
+
-
-
-
-
{script.title}
- {script.description?.trim() && (
-
{script.description}
- )}
-
- Read the script at your pace, then submit one clear take for review.
-
+
+
+
+
{script.title}
+
+
+ Read the script at your pace, then submit one clear take for review.
+
+
+
+ {script.status === "draft" && (
+
+
+
+
+
Draft preview
+
+ This script is still a draft and is hidden from other users.
+
+
+
+
+ )}
+
+ {script.spoiler && (
+
+
+
+
+
Potential campaign spoilers ahead
+
+ This script may include, infer, or otherwise expose campaign spoilers. Read on
+ only if you are comfortable with that.
+
+
+
+
+ )}
+
+
-
- {script.spoiler && (
-
-
-
-
-
Potential campaign spoilers ahead
-
- This script may include, infer, or otherwise expose campaign spoilers. Read on only
- if you are comfortable with that.
-
-
-
-
- )}
-
-
-
+
);
}
diff --git a/src/app/(frontend)/voiceover/page.tsx b/src/app/(frontend)/voiceover/page.tsx
index d6afee9..17f490b 100644
--- a/src/app/(frontend)/voiceover/page.tsx
+++ b/src/app/(frontend)/voiceover/page.tsx
@@ -8,6 +8,7 @@ import {
ArrowRightIcon,
CheckCircle2Icon,
Clock3Icon,
+ EyeOffIcon,
MicIcon,
SparklesIcon,
TriangleAlertIcon,
@@ -18,6 +19,7 @@ import { Button } from "@/components/ui/button";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
import { listScriptsForUser, type VoiceoverScriptView } from "@/lib/voiceover";
import { cn } from "@/lib/utils";
+import { redactText } from "@/lib/redaction";
import { isPayloadUser } from "@/utils/access-control/isPayloadUser";
export const metadata: Metadata = {
@@ -32,6 +34,7 @@ const submissionStatusClasses: Record
= {
};
function ScriptAvailability({ status }: { readonly status: string }) {
+ const isDraft = status === "draft";
const isOpen = status === "open";
return (
@@ -39,11 +42,19 @@ function ScriptAvailability({ status }: { readonly status: string }) {
variant="outline"
className={cn(
"shrink-0 gap-1",
- isOpen ? "border-emerald-500/40 text-emerald-400" : "text-muted-foreground",
+ isOpen && "border-emerald-500/40 text-emerald-400",
+ isDraft && "border-violet-500/50 text-violet-300",
+ !isOpen && !isDraft && "text-muted-foreground",
)}
>
- {isOpen ? : }
- {isOpen ? "Open" : "Closed"}
+ {isDraft ? (
+
+ ) : isOpen ? (
+
+ ) : (
+
+ )}
+ {isDraft ? "Draft" : isOpen ? "Open" : "Closed"}
);
}
@@ -81,15 +92,23 @@ function SpoilerBadge() {
}
function ScriptCard({ script }: { readonly script: VoiceoverScriptView }) {
+ const isDraft = script.status === "draft";
const isOpen = script.status === "open";
+ const isRecordable = isOpen;
return (
-
+
- {isOpen ? (
+ {isRecordable || isDraft ? (
- {script.description?.trim() || `Voiceover script #${script.id}`}
+ {(script.spoiler ? redactText(script.description) : script.description)?.trim() ||
+ `Voiceover script #${script.id}`}
@@ -129,7 +149,11 @@ function ScriptCard({ script }: { readonly script: VoiceoverScriptView }) {
- {isOpen ? (
+ {isDraft ? (
+
+ Draft preview: this script is still hidden from other users.
+
+ ) : isRecordable ? (