import React from "react"; import { Chip } from "./Chip"; // import "./chips.css"; export function ChipsInput(props: { value: string[]; onChange: (value: string[]) => void; placeholder?: string; label?: React.ReactNode; }) { const { value, onChange, placeholder = "Введите и нажмите Enter", label } = props; const [text, setText] = React.useState(""); const add = () => { const v = text.trim(); if (!v) return; if (value.includes(v)) { setText(""); return; } onChange([...value, v]); setText(""); }; return (