import { createFileRoute, useNavigate } from "@tanstack/react-router";
import { z } from "zod";
import { resetPassword } from "~/fns/login";
import { useAction } from "~/hooks/use-action";
import { AuthCard } from "~/components/AuthCard";
import { Button } from "~/ui/Button";
import { TextField } from "~/ui/Field";
import { ErrorBanner } from "~/ui/Callout";
import { TextLink } from "~/ui/TextLink";
export const Route = createFileRoute("/reset-password")({
validateSearch: z.object({ token: z.string().optional() }),
head: () => ({ meta: [{ title: "Choose a new password ยท gitfor" }] }),
component: ResetPasswordPage,
});
function ResetPasswordPage() {
const { token } = Route.useSearch();
const navigate = useNavigate();
const action = useAction(resetPassword);
if (!token) {
return (
Request a new link
);
}
return (
);
}