refactor: modals refactored

This commit is contained in:
2025-09-05 14:25:36 +04:00
parent 7694b4ae03
commit d0c734d481
24 changed files with 292 additions and 97 deletions

View File

@ -0,0 +1,28 @@
import { useForm, UseFormReturnType } from "@mantine/form";
import { SortDir } from "@/lib/client";
export type SortingForm = {
sortingField?: string;
sortingDirection: SortDir;
};
type ReturnType = {
form: UseFormReturnType<SortingForm>;
};
const useSorting = (): ReturnType => {
const initialFilters = {
sortingField: "createdAt",
sortingDirection: "asc" as SortDir,
};
const form = useForm<SortingForm>({
initialValues: initialFilters,
});
return {
form,
};
};
export default useSorting;