mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-25 07:45:47 +00:00
fix: reset input error when dialog is closed
This commit is contained in:
+17
-2
@@ -1,6 +1,6 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { Plus, MoreVertical, Pencil, Trash2 } from 'lucide-react';
|
import { Plus, MoreVertical, Pencil, Trash2 } from 'lucide-react';
|
||||||
import { Card, CardContent } from '@/figma-make/components/base/card';
|
import { Card, CardContent } from '@/figma-make/components/base/card';
|
||||||
import { Button } from '@/figma-make/components/base/button';
|
import { Button } from '@/figma-make/components/base/button';
|
||||||
@@ -404,7 +404,22 @@ export function MasterConfigurationContent() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Add/Edit Modal */}
|
{/* 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'>
|
<DialogContent className='sm:max-w-md bg-white rounded-xl shadow-lg'>
|
||||||
<DialogHeader>
|
<DialogHeader>
|
||||||
<DialogTitle>
|
<DialogTitle>
|
||||||
|
|||||||
Reference in New Issue
Block a user