返回 JoyAI-Echo
WorkflowSelector.tsx
根目录 / echo_longvideo / Director_Agent / webui / src / components / director / WorkflowSelector.tsx
1 import { Film, ScanLine } from "lucide-react";
2
3 import { cn } from "@/lib/utils";
4
5 export type WorkflowMode = "quick" | "director";
6
7 interface WorkflowSelectorProps {
8 onSelect: (mode: WorkflowMode) => void;
9 }
10
11 const workflows: Array<{
12 mode: WorkflowMode;
13 title: string;
14 description: string;
15 icon: typeof Film;
16 }> = [
17 {
18 mode: "quick",
19 title: "Quick Film",
20 description: "Describe an idea and let Director complete the full workflow.",
21 icon: Film,
22 },
23 {
24 mode: "director",
25 title: "Director Workshop",
26 description: "Review the story, references, and shots step by step.",
27 icon: ScanLine,
28 },
29 ];
30
31 export function WorkflowSelector({ onSelect }: WorkflowSelectorProps) {
32 return (
33 <div className="flex h-full w-full items-center justify-center px-6">
34 <div className="flex w-full max-w-2xl flex-col items-center gap-8">
35 <div className="text-center">
36 <h1 className="text-4xl font-light tracking-tight text-foreground/90">
37 Imagine it. Direct it.
38 </h1>
39 <p className="mt-2 text-sm text-muted-foreground">
40 Choose how you want to create with Echo Director.
41 </p>
42 </div>
43 <div className="grid w-full gap-4 sm:grid-cols-2">
44 {workflows.map(({ mode, title, description, icon: Icon }) => (
45 <button
46 key={mode}
47 type="button"
48 onClick={() => onSelect(mode)}
49 className={cn(
50 "group flex min-h-52 flex-col items-center justify-center gap-5 rounded-2xl p-8 text-center",
51 "border border-border/60 bg-card/40 transition-all duration-200",
52 "hover:-translate-y-1 hover:border-foreground/20 hover:bg-card hover:shadow-xl",
53 "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
54 )}
55 >
56 <span className="grid h-12 w-12 place-items-center rounded-xl bg-foreground/[0.06] ring-1 ring-inset ring-foreground/[0.08]">
57 <Icon className="h-5 w-5 text-foreground/60" />
58 </span>
59 <span>
60 <span className="block text-base font-medium text-foreground/90">
61 {title}
62 </span>
63 <span className="mt-2 block text-xs leading-5 text-muted-foreground">
64 {description}
65 </span>
66 </span>
67 </button>
68 ))}
69 </div>
70 </div>
71 </div>
72 );
73 }
74
74 lines Plain Text