MCPcopy
hub / github.com/nukeop/nuclear / BasicThemes

Function BasicThemes

packages/player/src/views/Themes/BasicThemes.tsx:9–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7import { useThemeStore } from '../../stores/themeStore';
8
9export const BasicThemes = () => {
10 const { t } = useTranslation('themes');
11 const basicThemes = useMemo(() => listBasicThemes(), []);
12 const { isSelected, selectBasicTheme } = useThemeStore();
13
14 return (
15 <SectionShell data-testid="basic-themes" title={t('basic')}>
16 <div className="flex flex-wrap gap-4 p-1">
17 {basicThemes.map((theme) => {
18 const isActive = isSelected({ type: 'basic', id: theme.id });
19 return (
20 <Button
21 key={theme.id}
22 aria-pressed={isActive}
23 variant="text"
24 size="flexible"
25 className={cn(
26 'bg-background-secondary border-border shadow-shadow hover:translate-x-shadow-x hover:translate-y-shadow-y flex flex-col justify-between gap-2 rounded-md border-(length:--border-width) px-4 py-2 transition hover:shadow-none',
27 {
28 'bg-primary': isActive,
29 },
30 )}
31 onClick={() => selectBasicTheme(theme.id)}
32 >
33 <span className="text-foreground text-left text-base font-bold">
34 {theme.name}
35 </span>
36 <div className="block">
37 {theme.palette.map((color, idx) => (
38 <span
39 key={idx}
40 aria-hidden
41 className="ring-border inline-block size-5 rounded-full ring-2"
42 style={{ backgroundColor: color }}
43 />
44 ))}
45 </div>
46 </Button>
47 );
48 })}
49 </div>
50 </SectionShell>
51 );
52};

Callers

nothing calls this directly

Calls 3

listBasicThemesFunction · 0.90
cnFunction · 0.90
selectBasicThemeFunction · 0.85

Tested by

no test coverage detected