返回 presentation-ai
ColorThemeGrid.tsx
1 "use client";
2
3 import { ThemeCard } from "@/components/presentation/edit-panel/sections/theme/ThemeCard";
4 import { type ColorTheme } from "./create-theme-types";
5
6 interface ColorThemeGridProps {
7 themes: ColorTheme[];
8 selectedTheme?: string | null;
9 onSelectTheme: (themeId: string) => void;
10 }
11
12 export function ColorThemeGrid({
13 themes,
14 selectedTheme,
15 onSelectTheme,
16 }: ColorThemeGridProps) {
17 if (!themes.length) return null;
18
19 return (
20 <div className="grid grid-cols-2 gap-3 lg:grid-cols-3">
21 {themes.map((theme) => (
22 <ThemeCard
23 showInfo={false}
24 key={theme.id}
25 themeId={theme.id}
26 theme={theme}
27 isSelected={selectedTheme === theme.id}
28 onSelect={onSelectTheme}
29 showFavoriteButton={false}
30 showEllipsis={false}
31 />
32 ))}
33 </div>
34 );
35 }
36
36 lines Plain Text