Remove callbacks

This commit is contained in:
Arthur Belleville 2025-04-12 22:49:20 +02:00
parent 0fdb0b1c2a
commit bbe02bff13
No known key found for this signature in database

View file

@ -7,7 +7,7 @@ import {
} from "ag-grid-community";
import { AgGridReact } from "ag-grid-react";
import { useDevisList, useCreateDevis, useDeleteDevis } from "@ui/hooks/devis";
import { useCallback, useState } from "react";
import { useState } from "react";
import { Database } from "@ui/types/db";
import { Modal } from "@ui/ui-library/modal";
import {
@ -56,20 +56,20 @@ export const DevisPage = () => {
const [selectedDevis, setSelectedDevis] = useState<Devis | null>(null);
const [formData, setFormData] = useState(defaultFormData);
const validateDueDate = useCallback((date: DateValue, dueDate: DateValue) => {
const validateDueDate = (date: DateValue, dueDate: DateValue) => {
if (dueDate.compare(date) < 0) {
return "La date d'échéance doit être postérieure à la date de création";
}
return "";
}, []);
};
const calculateTax = useCallback((amount: number, taxRate: number) => {
const calculateTax = (amount: number, taxRate: number) => {
return (amount * taxRate) / 100;
}, []);
};
const calculateTotal = useCallback((amount: number, tax: number) => {
const calculateTotal = (amount: number, tax: number) => {
return amount + tax;
}, []);
};
const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault();