Exam Edit on ExamList
This commit is contained in:
@@ -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)}
|
||||
/>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user