import { oklch, formatHex } from "culori"; import { memo } from "react"; import { FlatList, View } from "react-native"; import { useTranslation } from "@turbostarter/i18n"; import { cn, ThemeColor, ThemeMode, themes } from "@turbostarter/ui"; import { Button } from "./button"; import { Icons } from "./icons"; import { Label } from "./label"; import { Text } from "./text"; import type { ThemeConfig } from "@turbostarter/ui"; interface ThemeCustomizerProps { readonly config: ThemeConfig; readonly onChange: (config: ThemeConfig) => void; readonly resolvedTheme: Exclude; } export const MODE_ICONS = { [ThemeMode.LIGHT]: Icons.Sun, [ThemeMode.DARK]: Icons.Moon, [ThemeMode.SYSTEM]: Icons.SunMoon, } as const; export const ThemeCustomizer = memo( ({ config, onChange, resolvedTheme }) => { const { t } = useTranslation("common"); return ( { const [l, c, h, alpha] = themes[item][resolvedTheme].primary; return ( ); }} /> { const isActive = config.mode === item; const Icon = MODE_ICONS[item]; return ( ); }} /> ); }, ); ThemeCustomizer.displayName = "ThemeCustomizer";