import { auth } from "~/server/auth"; import { Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow, } from "~/app/_components/ui/table"; import { UserNav } from "~/app/_components/user-nav"; import { DataTable } from "~/app/_components/data-table"; import { z } from "zod"; import { promises as fs } from "fs"; import path from "path"; import { columns } from "~/app/_components/columns"; import { taskSchema } from "~/app/_components/schema"; async function getTasks() { const data = await fs.readFile( path.join(process.cwd(), "src/app/_data/tasks.json"), ); const tasks = JSON.parse(data.toString()); return z.array(taskSchema).parse(tasks); } export default async function Home() { const session = await auth(); if (!session) { Not signed in ; } const tasks = await getTasks(); return ( {session?.user.name ? `${session.user.name}'s notes` : "notes"} {/* A list of your recent invoices. Invoice Status Method Amount INV001 Paid Credit Card $250.00 */} Welcome back! Here's a list of your tasks for this month! ); }
Here's a list of your tasks for this month!