import { useEffect } from "react"; import type { ConfigField } from "@/lib/config-schemas"; import { GOOGLE_FONTS, SYSTEM_FONT_ID, fontFamilyCss, injectGoogleFontsStylesheet, normalizeGoogleFontValue, } from "@/lib/google-fonts"; import { Label } from "@/components/ui/label"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select"; interface GoogleFontPickerProps { field: ConfigField; value: unknown; onChange: (value: unknown) => void; readOnly?: boolean; } export function GoogleFontPicker({ field, value, onChange, readOnly, }: GoogleFontPickerProps) { const id = field.path.replace(/\./g, "-"); const selected = normalizeGoogleFontValue(value); useEffect(() => { injectGoogleFontsStylesheet(); }, []); return (
{field.description}
) : null}