2025-09-02 16:24:13 -05:00
|
|
|
import { TextField } from "@radix-ui/themes";
|
|
|
|
|
import type { EmbedPreviewControllerProps } from "../../pages/[...locale]/embed/[embed]/_index";
|
|
|
|
|
import { EmbedState } from "../../stores/embedState";
|
2024-10-26 14:33:04 -05:00
|
|
|
|
|
|
|
|
export function TextController({ configKey }: EmbedPreviewControllerProps) {
|
|
|
|
|
return (
|
|
|
|
|
<TextField.Root
|
2025-04-21 17:01:32 -05:00
|
|
|
variant="classic"
|
2024-10-26 14:33:04 -05:00
|
|
|
placeholder="Empty"
|
|
|
|
|
value={EmbedState.use((state) => state[configKey] as string)}
|
|
|
|
|
onChange={(event) => {
|
2025-09-02 16:24:13 -05:00
|
|
|
EmbedState.mutate((draft) => {
|
2024-10-26 14:33:04 -05:00
|
|
|
draft[configKey] = event.target.value;
|
|
|
|
|
});
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
}
|