mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
fix: reset input error when dialog is closed
This commit is contained in:
+17
-2
@@ -1,6 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { useState } from 'react';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { Plus, MoreVertical, Pencil, Trash2 } from 'lucide-react';
|
||||
import { Card, CardContent } from '@/figma-make/components/base/card';
|
||||
import { Button } from '@/figma-make/components/base/button';
|
||||
@@ -404,7 +404,22 @@ export function MasterConfigurationContent() {
|
||||
</div>
|
||||
|
||||
{/* Add/Edit Modal */}
|
||||
<Dialog open={showModal} onOpenChange={setShowModal}>
|
||||
<Dialog
|
||||
open={showModal}
|
||||
onOpenChange={(open) => {
|
||||
if (!open) {
|
||||
setIsFormInvalid(false);
|
||||
setConfigurationForm({
|
||||
id: 0,
|
||||
date: '',
|
||||
percentage_threshold_bad: '',
|
||||
percentage_threshold_enough: '',
|
||||
});
|
||||
}
|
||||
|
||||
setShowModal(open);
|
||||
}}
|
||||
>
|
||||
<DialogContent className='sm:max-w-md bg-white rounded-xl shadow-lg'>
|
||||
<DialogHeader>
|
||||
<DialogTitle>
|
||||
|
||||
Reference in New Issue
Block a user