mirror of
https://github.com/hanzoai/shadcn.git
synced 2026-11-02 13:07:46 +00:00
Squash merge of shadcn-ui/ui main branch into hanzo/ui, bringing in: - [email protected] through [email protected] releases - New apps/v4 directory structure - Registry system improvements and MCP server - Framework support (Vue, Svelte, React Native) - New templates (vite-app, monorepo-next, laravel) - Zod 4 compatibility (scoped override for zod@>4) - Test fixture corrections for alias resolution All 867 merge conflicts resolved preserving Hanzo customizations. 1020/1020 shadcn tests pass.
68 lines
1.8 KiB
TypeScript
68 lines
1.8 KiB
TypeScript
import { promises as fs } from "fs"
|
|
import path from "path"
|
|
import { type Metadata } from "next"
|
|
import Image from "next/image"
|
|
import { z } from "zod"
|
|
|
|
import { columns } from "./components/columns"
|
|
import { DataTable } from "./components/data-table"
|
|
import { UserNav } from "./components/user-nav"
|
|
import { taskSchema } from "./data/schema"
|
|
|
|
export const metadata: Metadata = {
|
|
title: "Tasks",
|
|
description: "A task and issue tracker build using Tanstack Table.",
|
|
}
|
|
|
|
// Simulate a database read for tasks.
|
|
async function getTasks() {
|
|
const data = await fs.readFile(
|
|
path.join(process.cwd(), "app/(app)/examples/tasks/data/tasks.json")
|
|
)
|
|
|
|
const tasks = JSON.parse(data.toString())
|
|
|
|
return z.array(taskSchema).parse(tasks)
|
|
}
|
|
|
|
export default async function TaskPage() {
|
|
const tasks = await getTasks()
|
|
|
|
return (
|
|
<>
|
|
<div className="md:hidden">
|
|
<Image
|
|
src="/examples/tasks-light.png"
|
|
width={1280}
|
|
height={998}
|
|
alt="Playground"
|
|
className="block dark:hidden"
|
|
/>
|
|
<Image
|
|
src="/examples/tasks-dark.png"
|
|
width={1280}
|
|
height={998}
|
|
alt="Playground"
|
|
className="hidden dark:block"
|
|
/>
|
|
</div>
|
|
<div className="hidden h-full flex-1 flex-col gap-8 p-8 md:flex">
|
|
<div className="flex items-center justify-between gap-2">
|
|
<div className="flex flex-col gap-1">
|
|
<h2 className="text-2xl font-semibold tracking-tight">
|
|
Welcome back!
|
|
</h2>
|
|
<p className="text-muted-foreground">
|
|
Here's a list of your tasks for this month.
|
|
</p>
|
|
</div>
|
|
<div className="flex items-center gap-2">
|
|
<UserNav />
|
|
</div>
|
|
</div>
|
|
<DataTable data={tasks} columns={columns} />
|
|
</div>
|
|
</>
|
|
)
|
|
}
|