import React from "react"; import { Button } from "@/components/Button"; import { Input } from "@/components/Input"; import { useThemeContext, emptyPalette } from "@/components/Theme"; import styles from "./themer.module.css"; export default function Themer() { const context = useThemeContext(); const palette = context?.theme.palette ?? emptyPalette; return (

Themer

event.preventDefault()}>
{Object.entries(palette).map(([key, value]) => { const color = value.length === 4 && value.startsWith("#") ? `#${value[1].repeat(2)}${value[2].repeat(2)}${value[3].repeat( 2 )}` : value; const isValidColor = color.startsWith("#") && color.length === 7; return (
context?.setTheme({ [key]: event.target.value }) } />
); })}
{" "}
); }