40b99f3add
Deploy / deploy (push) Successful in 3m19s
At phone width the sidebar stayed 240px wide, leaving pages a ~135px strip. Below md it is now hidden behind a menu button in the header and opens as a drawer (closes on navigation, backdrop, X or Escape); from md up the sidebar is unchanged. Page wrappers use p-4 on phones and keep p-6/p-8 from md. Shot detail: on phones the thumbnail takes the full width with the details below it instead of pushing them off screen, the action buttons wrap, and the tab bar scrolls sideways. Desktop sizing is kept as it was. Every change is behind a md: breakpoint, so the desktop layout is the same. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
50 lines
1.4 KiB
TypeScript
50 lines
1.4 KiB
TypeScript
import { Metadata } from "next";
|
|
import { auth } from "@/auth";
|
|
import { redirect } from "next/navigation";
|
|
import { db } from "@/lib/db";
|
|
import { UsersClient } from "@/components/users/UsersClient";
|
|
import { Users } from "lucide-react";
|
|
|
|
export const metadata: Metadata = { title: "User Management" };
|
|
|
|
export default async function UsersPage() {
|
|
const session = await auth();
|
|
if (!session || session.user.role !== "ADMIN") {
|
|
redirect("/dashboard");
|
|
}
|
|
|
|
const users = await db.user.findMany({
|
|
orderBy: [{ role: "asc" }, { name: "asc" }, { email: "asc" }],
|
|
select: {
|
|
id: true,
|
|
name: true,
|
|
email: true,
|
|
role: true,
|
|
isActive: true,
|
|
createdAt: true,
|
|
},
|
|
});
|
|
|
|
// Serialize dates
|
|
const serialized = users.map((u) => ({
|
|
...u,
|
|
createdAt: u.createdAt.toISOString(),
|
|
}));
|
|
|
|
return (
|
|
<div className="p-4 md:p-6 max-w-5xl mx-auto space-y-6">
|
|
<div className="flex items-center gap-3">
|
|
<div className="w-10 h-10 rounded-lg bg-amber-500/10 border border-amber-500/20 flex items-center justify-center shrink-0">
|
|
<Users className="h-5 w-5 text-amber-400" />
|
|
</div>
|
|
<div>
|
|
<h1 className="text-2xl font-bold text-white">User Management</h1>
|
|
<p className="text-sm text-zinc-400 mt-0.5">Manage studio accounts, roles, and access</p>
|
|
</div>
|
|
</div>
|
|
|
|
<UsersClient users={serialized} currentUserId={session.user.id!} />
|
|
</div>
|
|
);
|
|
}
|