43 lines
947 B
TypeScript
43 lines
947 B
TypeScript
import {
|
|
Select,
|
|
SelectContent,
|
|
SelectItem,
|
|
SelectTrigger,
|
|
SelectValue,
|
|
} from "@/components/ui/select";
|
|
import { FONT_OPTIONS, type FontFamily } from "@/constants/font-constants";
|
|
|
|
interface FontPickerProps {
|
|
defaultValue?: FontFamily;
|
|
onValueChange?: (value: FontFamily) => void;
|
|
className?: string;
|
|
}
|
|
|
|
export function FontPicker({
|
|
defaultValue,
|
|
onValueChange,
|
|
className,
|
|
}: FontPickerProps) {
|
|
return (
|
|
<Select defaultValue={defaultValue} onValueChange={onValueChange}>
|
|
<SelectTrigger
|
|
className={`bg-panel-accent h-9 w-full text-base ${className || ""}`}
|
|
>
|
|
<SelectValue placeholder="Select a font" className="text-sm" />
|
|
</SelectTrigger>
|
|
<SelectContent>
|
|
{FONT_OPTIONS.map((font) => (
|
|
<SelectItem
|
|
key={font.value}
|
|
value={font.value}
|
|
className="text-sn"
|
|
style={{ fontFamily: font.value }}
|
|
>
|
|
{font.label}
|
|
</SelectItem>
|
|
))}
|
|
</SelectContent>
|
|
</Select>
|
|
);
|
|
}
|