import { useMutation } from "@tanstack/react-query" function useLogin() { return useMutation({ mutationFn: async (creds: { username: string; password: string }) => { return await fetch(`${import.meta.env.VITE_API_URL}/api/login`, { method: "POST", body: JSON.stringify(creds), credentials: "include", }) }, }) } export { useLogin }