feat(docs): add docs and restructure

This commit is contained in:
BennyKok
2023-12-28 00:06:32 +08:00
parent afc67bc0b9
commit 498374195d
56 changed files with 3751 additions and 54 deletions
+29
View File
@@ -0,0 +1,29 @@
import { MachineList } from "@/components/MachineList";
import { db } from "@/db/db";
import { machinesTable } from "@/db/schema";
import { auth } from "@clerk/nextjs";
import { desc, eq } from "drizzle-orm";
export default function Page() {
return <MachineListServer />;
}
async function MachineListServer() {
const { userId } = await auth();
if (!userId) {
return <div>No auth</div>;
}
const machines = await db.query.machinesTable.findMany({
orderBy: desc(machinesTable.updated_at),
where: eq(machinesTable.user_id, userId),
});
return (
<div className="w-full">
{/* <div>Machines</div> */}
<MachineList data={machines} />
</div>
);
}