import Link from "next/link"; import { auth } from "~/server/auth"; import { HydrateClient } from "~/trpc/server"; import FileGrid from "~/app/_components/FileGrid"; import UploadForm from "~/app/_components/UploadForm"; import { Toaster } from "react-hot-toast"; export default async function Home() { const session = await auth(); return (
{/* Top-right corner sign-out button */} {session?.user && (
Sign out
)}

File Hosting

{/* Conditionally render FileGrid and UploadForm if the user is logged in */} {session?.user ? ( <> ) : (

Please log in to upload and view files.

)} {!session?.user && (
{session ? "Sign out" : "Sign in"}
)}
); }