import { FontBoldIcon, FontSizeIcon } from "@radix-ui/react-icons"; import { Flex, Slider, Text } from "@radix-ui/themes"; import type { EmbedPreviewControllerProps } from "../../pages/[...locale]/embed/[embed]/_index"; import { EmbedState, type RadixSizeWithout0 } from "../../stores/embedState"; import { radixTextWeights, type EmbedConfigItemType, type EmbedItemType, } from "../../stores/embedState/constants"; import { ColorControllerRaw } from "./ColorControllerRaw"; export function RichText({ configKey }: EmbedPreviewControllerProps) { const state = EmbedState.use( (state) => state[configKey] as EmbedConfigItemType["default"] ); return ( { EmbedState.mutate((draft) => { ( draft[ configKey ] as EmbedConfigItemType["default"] ).color = value; }); }} /> { EmbedState.mutate((draft) => { ( draft[ configKey ] as EmbedConfigItemType["default"] ).size = `${value}` as RadixSizeWithout0; }); }} /> { EmbedState.mutate((draft) => { ( draft[ configKey ] as EmbedConfigItemType["default"] ).weight = radixTextWeights[value]; }); }} /> ); }