2024-10-26 14:33:04 -05:00
|
|
|
import { TextField } from '@radix-ui/themes';
|
2024-12-27 12:38:38 -06:00
|
|
|
import type { EmbedPreviewControllerProps } from '../../pages/[...locale]/tools/embed/[embed]/_index';
|
2024-10-26 14:33:04 -05:00
|
|
|
import { EmbedState } from '../../stores/embedState';
|
|
|
|
|
|
|
|
|
|
export function TextController({ configKey }: EmbedPreviewControllerProps) {
|
|
|
|
|
const mutateEmbedState = EmbedState.useMutation();
|
|
|
|
|
|
|
|
|
|
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) => {
|
|
|
|
|
mutateEmbedState((draft) => {
|
|
|
|
|
draft[configKey] = event.target.value;
|
|
|
|
|
});
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
}
|