nice
This commit is contained in:
parent
4d27d791f1
commit
87b608f7b9
@ -559,17 +559,6 @@ const TimeClockPage = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleDeleteEntry = async (id) => {
|
const handleDeleteEntry = async (id) => {
|
||||||
// Remplacer window.confirm par le composant ConfirmDialog
|
|
||||||
const confirmed = await new Promise((resolve) => {
|
|
||||||
// Pour cette implémentation, nous allons directement utiliser le composant
|
|
||||||
// dans le JSX plutôt que de le gérer ici
|
|
||||||
resolve(true); // On résout directement pour l'exemple
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!confirmed) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await timeApi.deleteTimeEntry(id);
|
await timeApi.deleteTimeEntry(id);
|
||||||
loadTimeEntries(); // Refresh the list
|
loadTimeEntries(); // Refresh the list
|
||||||
@ -955,9 +944,6 @@ const TimeClockPage = () => {
|
|||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
{isAdmin && (
|
{isAdmin && (
|
||||||
<Card className="mb-4">
|
<Card className="mb-4">
|
||||||
<CardHeader className="border-b">
|
|
||||||
<CardTitle>Utilisateur</CardTitle>
|
|
||||||
</CardHeader>
|
|
||||||
<CardContent className="space-y-4">
|
<CardContent className="space-y-4">
|
||||||
<div className="flex flex-col gap-3 md:flex-row md:items-end">
|
<div className="flex flex-col gap-3 md:flex-row md:items-end">
|
||||||
<div className="min-w-0 flex-1">
|
<div className="min-w-0 flex-1">
|
||||||
@ -1158,7 +1144,7 @@ const TimeClockPage = () => {
|
|||||||
<Table>
|
<Table>
|
||||||
<TableHeader>
|
<TableHeader>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
{isAdmin && <TableHead>Utilisateur</TableHead>}
|
{isAdmin && <TableHead>Nom</TableHead>}
|
||||||
<TableHead>Date</TableHead>
|
<TableHead>Date</TableHead>
|
||||||
<TableHead>Entrée</TableHead>
|
<TableHead>Entrée</TableHead>
|
||||||
<TableHead>Sortie</TableHead>
|
<TableHead>Sortie</TableHead>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user