Use ThemeEnum directly in embed-dialog

This commit is contained in:
Your Name 2025-11-28 09:48:34 +00:00
parent 0b27022931
commit db8e1b03f3

View file

@ -22,6 +22,7 @@ import { SharedFrom } from '@/constants/chat';
import { import {
LanguageAbbreviation, LanguageAbbreviation,
LanguageAbbreviationMap, LanguageAbbreviationMap,
ThemeEnum,
} from '@/constants/common'; } from '@/constants/common';
import { useTranslate } from '@/hooks/common-hooks'; import { useTranslate } from '@/hooks/common-hooks';
import { IModalProps } from '@/interfaces/common'; import { IModalProps } from '@/interfaces/common';
@ -36,7 +37,7 @@ const FormSchema = z.object({
locale: z.string(), locale: z.string(),
embedType: z.enum(['fullscreen', 'widget']), embedType: z.enum(['fullscreen', 'widget']),
enableStreaming: z.boolean(), enableStreaming: z.boolean(),
theme: z.enum(['light', 'dark']), theme: z.enum([ThemeEnum.Light, ThemeEnum.Dark]),
}); });
type IProps = IModalProps<any> & { type IProps = IModalProps<any> & {
@ -62,7 +63,7 @@ function EmbedDialog({
locale: '', locale: '',
embedType: 'fullscreen' as const, embedType: 'fullscreen' as const,
enableStreaming: false, enableStreaming: false,
theme: 'light' as const, theme: ThemeEnum.Light,
}, },
}); });
@ -200,13 +201,16 @@ function EmbedDialog({
className="flex flex-row space-x-4" className="flex flex-row space-x-4"
> >
<div className="flex items-center space-x-2"> <div className="flex items-center space-x-2">
<RadioGroupItem value="light" id="light" /> <RadioGroupItem
value={ThemeEnum.Light}
id="light"
/>
<Label htmlFor="light" className="text-sm"> <Label htmlFor="light" className="text-sm">
Light Light
</Label> </Label>
</div> </div>
<div className="flex items-center space-x-2"> <div className="flex items-center space-x-2">
<RadioGroupItem value="dark" id="dark" /> <RadioGroupItem value={ThemeEnum.Dark} id="dark" />
<Label htmlFor="dark" className="text-sm"> <Label htmlFor="dark" className="text-sm">
Dark Dark
</Label> </Label>