Remove callbacks
This commit is contained in:
parent
0fdb0b1c2a
commit
bbe02bff13
1 changed files with 7 additions and 7 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue