mirror of
https://github.com/ichsankurnia/hats-app.git
synced 2026-12-06 19:16:28 +00:00
fixing ui, logic etc..
This commit is contained in:
@@ -16,8 +16,8 @@ import {
|
||||
import { DUMMY_EMPLOYEES, IClient } from '../types';
|
||||
import { useState } from 'react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { ConfirmDelete } from '@/components/modal/ConfirmDelete';
|
||||
import FormClient from './FormClient';
|
||||
import { ConfirmDeleteWithInput } from '@/components/modal/ConfirmDeleteWithInput';
|
||||
|
||||
export default function ClientGrid({ clients, assignments }: { clients: IClient[], assignments: any[] }) {
|
||||
const router = useRouter();
|
||||
@@ -172,7 +172,10 @@ export default function ClientGrid({ clients, assignments }: { clients: IClient[
|
||||
</div>
|
||||
|
||||
{action === 'EDIT' && <FormClient data={selectedData} onCancel={handleClose} onSuccess={() => { router.refresh(); handleClose() }} />}
|
||||
{action === 'DELETE' ? <ConfirmDelete endpoint={`/client/${selectedData?.id}`} onCancel={handleClose} onSuccess={() => { router.refresh(); handleClose() }} /> : null}
|
||||
{action === 'DELETE' ? <ConfirmDeleteWithInput endpoint={`/client/${selectedData?.id}`} onCancel={handleClose} onSuccess={() => { router.refresh(); handleClose() }}
|
||||
title={selectedData?.name!} description={`This action cannot be undone. This will permanently delete and remove client ${selectedData?.name} from our servers.`}
|
||||
titleButton={`I understand the consequences, delete this client`}
|
||||
/> : null}
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user