"use client"; import { useId, useState } from "react"; import { normalizeTags } from "@/lib/validate"; type Props = { value: string[]; onChange: (tags: string[]) => void; suggestions: string[] }; /** Chip-style tag entry: Enter or comma adds, Backspace on empty removes the last. */ export default function TagInput({ value, onChange, suggestions }: Props) { const [draft, setDraft] = useState(""); const listId = useId(); function commit(text: string) { if (!text.trim()) return; onChange(normalizeTags([...value, ...text.split(",")])); setDraft(""); } return (