import { useRuleStore } from "@/stores/ruleStore"; import { Input } from "@/components/ui/input"; import { NumberInput } from "@/components/ui/number-input"; import { SegmentedControl } from "@/components/ui/segmented-control"; import { Checkbox } from "@/components/ui/checkbox"; import type { NumberingConfig as NumberingConfigType } from "@/types/rules"; const numberModes = [ { value: "None", label: "None" }, { value: "Prefix", label: "Prefix" }, { value: "Suffix", label: "Suffix" }, { value: "Both", label: "Both" }, { value: "Insert", label: "Insert" }, ] as const; const bases = [ { value: "Decimal", label: "Dec" }, { value: "Hex", label: "Hex" }, { value: "Octal", label: "Oct" }, { value: "Binary", label: "Bin" }, { value: "Alpha", label: "Alpha" }, { value: "Roman", label: "Roman" }, ] as const; export function NumberingConfig({ ruleId }: { ruleId: string }) { const rule = useRuleStore((s) => s.pipeline.find((r) => r.id === ruleId))?.config as NumberingConfigType | undefined; const updateRule = useRuleStore((s) => s.updateRule); if (!rule) return null; const update = (changes: Partial) => updateRule(ruleId, changes); return (
Position update({ mode: m })} options={numberModes} />
Base update({ base: b })} options={bases} size="sm" />
); }