Exam Edit on ExamList

This commit is contained in:
Carlos-Mesquita
2024-11-27 02:01:50 +00:00
parent ca5977e78b
commit a2a513077f
13 changed files with 199 additions and 53 deletions

View File

@@ -22,18 +22,13 @@ const PromptEdit: React.FC<Props> = ({ value, onChange, wrapperCard = true }) =>
));
};
const handleTextChange = (text: string) => {
const escapedText = text.replace(/\n/g, '\\n');
onChange(escapedText);
};
const promptEditTsx = (
<div className="flex justify-between items-start gap-4">
{editing ? (
<AutoExpandingTextArea
className="flex-1 p-3 border rounded-lg focus:ring-2 focus:ring-blue-500 focus:outline-none min-h-[100px]"
value={value.replace(/\\n/g, '\n')}
onChange={handleTextChange}
value={value}
onChange={onChange}
onBlur={() => setEditing(false)}
/>
) : (