import { Button } from "~/components/ui/button"; import Card, { CardTitle } from "~/components/ui/card"; import { FormLabel } from "~/components/ui/form-field"; import Input from "~/components/ui/input"; import { useData } from "~/renderer/hooks"; import { Data } from "./+data"; import { useForm } from "~/hooks/useForm"; import { z } from "zod"; import { Controller } from "react-hook-form"; import { navigate } from "vike/client/router"; import Divider from "~/components/ui/divider"; import trpc from "~/lib/trpc"; import { useAuth } from "~/hooks/useAuth"; import { usePageContext } from "~/renderer/context"; const schema = z.object({ forkFromId: z.number(), title: z.string(), user: z .object({ name: z.string().min(3), email: z.string().email(), password: z.string().min(6), }) .optional(), }); const initialValue: z.infer = { forkFromId: 0, title: "", }; const GetStartedPage = () => { const { presets } = useData(); const { isLoggedIn } = useAuth(); const ctx = usePageContext(); const form = useForm(schema, initialValue); const create = trpc.project.create.useMutation({ onSuccess(data) { navigate(`/${data.slug}`); }, }); const onSubmit = form.handleSubmit((values) => { create.mutate(values); }); return (
Create New Project
Select Preset (
{presets.map((preset) => ( ))}
)} /> {!isLoggedIn ? (

Account detail

Already have an account?

) : null}
); }; export default GetStartedPage;