mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
20 lines
563 B
TypeScript
20 lines
563 B
TypeScript
import { TextField } from '@radix-ui/themes';
|
|
import * as EmbedState from '../../../../../stores/embedState';
|
|
import { EmbedPreviewControllerProps } from '../page';
|
|
|
|
export function Text({ configKey }: EmbedPreviewControllerProps) {
|
|
const mutateEmbedState = EmbedState.useMutation();
|
|
|
|
return (
|
|
<TextField.Root
|
|
placeholder="Empty"
|
|
value={EmbedState.use((state) => state[configKey] as string)}
|
|
onChange={(event) => {
|
|
mutateEmbedState((draft) => {
|
|
draft[configKey] = event.target.value;
|
|
});
|
|
}}
|
|
/>
|
|
);
|
|
}
|