import { useState } from 'react'; import { Input } from '@librechat/client'; import { Cross1Icon } from '@radix-ui/react-icons'; import type { TPrompt } from 'librechat-data-provider'; import { useUpdatePromptLabels } from '~/data-provider'; const PromptForm = ({ selectedPrompt }: { selectedPrompt?: TPrompt }) => { const [labelInput, setLabelInput] = useState(''); const [labels, setLabels] = useState([]); const updatePromptLabelsMutation = useUpdatePromptLabels(); const handleInputChange = (e: React.ChangeEvent) => { setLabelInput(e.target.value); }; const handleKeyPress = (e: React.KeyboardEvent) => { if (e.key === 'Enter' && labelInput.trim()) { const newLabels = [...labels, labelInput.trim()]; setLabels(newLabels); setLabelInput(''); updatePromptLabelsMutation.mutate({ id: selectedPrompt?._id || '', payload: { labels: newLabels }, }); } }; return ( <>

Labels

{labels.length ? ( labels.map((label, index) => ( )) ) : ( )}
); }; export default PromptForm;