"use client"; import * as React from "react"; import { Slider } from "../../primitives"; export function LetterSpacingIcon(): React.JSX.Element { return ( ); } export function LineHeightIcon(): React.JSX.Element { return ( ); } export function FontPickerFooterControl({ disabled, icon, onValueChange, steps, title, valueIndex, }: { disabled: boolean; icon: React.ReactNode; onValueChange: (nextValue: number) => void; steps: readonly unknown[]; title: string; valueIndex: number; }): React.JSX.Element { const markerValues = steps.map((_, index) => index); const min = 0; const max = Math.max(0, markerValues.length - 1); const currentValue = Math.min(max, Math.max(min, Math.round(valueIndex))); return (
{icon}
title} markerValues={markerValues} max={max} min={min} onValueChange={(nextValue) => { const resolvedValue = Array.isArray(nextValue) ? nextValue[0] : nextValue; if (typeof resolvedValue === "number") { onValueChange(Math.min(max, Math.max(min, Math.round(resolvedValue)))); } }} showFill snapValues={markerValues} step={1} value={[currentValue]} variant="discrete" />
); }