···11import { redirect } from "next/navigation";
2233-import Group from "@/components/group";
33+import { Group } from "@/components/group";
44import { getGroup } from "@/lib/group";
55import { redeemInvite } from "@/lib/invite";
66import { getVouchers } from "@/lib/voucher";
+30-37
src/app/auth/page.tsx
···2233import { TicketStarIcon } from "@hugeicons/core-free-icons";
44import { HugeiconsIcon } from "@hugeicons/react";
55+import { use } from "react";
56import { Button } from "@/components/ui/button";
67import {
77- Field,
88- FieldDescription,
99- FieldGroup,
1010- FieldLabel,
1111-} from "@/components/ui/field";
88+ Empty,
99+ EmptyContent,
1010+ EmptyDescription,
1111+ EmptyHeader,
1212+ EmptyMedia,
1313+ EmptyTitle,
1414+} from "@/components/ui/empty";
1215import { authClient } from "@/lib/auth-client";
13161417export default function Auth({
1518 searchParams,
1619}: {
1717- searchParams: { next?: string };
2020+ searchParams: Promise<{ next?: string }>;
1821}) {
1919- const next = searchParams.next || "/";
2222+ const { next } = use(searchParams);
20232124 return (
2222- <div className="flex flex-col h-screen justify-center gap-6 w-md mx-auto">
2323- <FieldGroup>
2424- <div className="flex flex-col items-center gap-2">
2525+ <Empty className="h-screen">
2626+ <EmptyHeader>
2727+ <EmptyMedia variant="icon">
2528 <HugeiconsIcon icon={TicketStarIcon} />
2626- <FieldLabel className="text-xl font-bold">
2727- Welcome to Vouch
2828- </FieldLabel>
2929- <FieldDescription className="text-center">
3030- Sign in using a third-party provider.
3131- </FieldDescription>
3232- </div>
3333- <Field>
3434- <Button
3535- variant="outline"
3636- type="button"
3737- onClick={() => {
3838- authClient.signIn.social({
3939- provider: "google",
4040- callbackURL: next,
4141- });
4242- }}
4343- >
4444- Continue with Google
4545- </Button>
4646- </Field>
4747- </FieldGroup>
4848- <FieldDescription className="px-6 text-center">
4949- By clicking continue, you agree to our <a href="#">Terms of Service</a>{" "}
5050- and <a href="#">Privacy Policy</a>.
5151- </FieldDescription>
5252- </div>
2929+ </EmptyMedia>
3030+ <EmptyTitle>Welcome to Vouch</EmptyTitle>
3131+ <EmptyDescription>You need to sign in to continue</EmptyDescription>
3232+ </EmptyHeader>
3333+ <EmptyContent>
3434+ <Button
3535+ onClick={() =>
3636+ authClient.signIn.social({
3737+ provider: "google",
3838+ callbackURL: next || "/",
3939+ })
4040+ }
4141+ >
4242+ Continue with Google
4343+ </Button>
4444+ </EmptyContent>
4545+ </Empty>
5346 );
5447}