返回 presentation-ai
ThemeCard.tsx
1 import { type ThemeProperties } from "@/lib/presentation/themes";
2 import { cn } from "@/lib/utils";
3
4 export default function ThemeCard({
5 theme,
6 selectedColorTheme,
7 setSelectedColorTheme,
8 }: {
9 theme: ThemeProperties & { id: string };
10 selectedColorTheme: string;
11 setSelectedColorTheme: (themeId: string) => void;
12 }) {
13 return (
14 <button
15 key={theme.id}
16 onClick={() => setSelectedColorTheme(theme.id)}
17 className={cn(
18 "rounded-lg border-2 transition-all hover:shadow-md",
19 selectedColorTheme === theme.id
20 ? "border-purple-600 ring-2 ring-purple-200 dark:ring-purple-800"
21 : "border-border hover:border-muted-foreground",
22 )}
23 >
24 <div
25 className={cn("rounded-t-md p-3")}
26 style={{ borderRadius: theme.borderRadius.button }}
27 >
28 <div
29 className={cn(
30 "flex min-h-[80px] flex-col justify-center rounded p-3",
31 )}
32 style={{
33 backgroundColor: theme.colors.primary,
34 }}
35 >
36 <div
37 className={cn("mb-1.5 text-center text-xs font-semibold")}
38 style={{
39 color: theme.colors.text,
40 }}
41 >
42 This is a theme
43 </div>
44 <div
45 className={cn("mb-2 text-center text-[10px] leading-tight")}
46 style={{
47 color: theme.colors.text,
48 }}
49 >
50 Body text with{" "}
51 <span
52 className={cn("underline")}
53 style={{
54 color: theme.colors.accent,
55 }}
56 >
57 link
58 </span>
59 </div>
60 <div className={cn("mx-auto h-1.5 w-1/2 rounded")} />
61 </div>
62 </div>
63 </button>
64 );
65 }
66
66 lines Plain Text