@@ -4,6 +4,7 @@ import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
|
||||
import { getInitials } from "@/lib/utils";
|
||||
import { ChangePasswordForm } from "@/components/settings/ChangePasswordForm";
|
||||
import { HetznerConfigForm } from "@/components/settings/HetznerConfigForm";
|
||||
import { SketchTemplatesSection } from "@/components/settings/SketchTemplatesSection";
|
||||
import { getHetznerConfig } from "@/actions/settings";
|
||||
|
||||
export const metadata = { title: "Settings" };
|
||||
@@ -13,6 +14,7 @@ export default async function SettingsPage() {
|
||||
if (!session?.user) return null;
|
||||
|
||||
const isAdmin = session.user.role === "ADMIN";
|
||||
const canManageTemplates = ["ADMIN", "PRODUCER", "SUPERVISOR"].includes(session.user.role ?? "");
|
||||
const hetznerConfig = isAdmin ? await getHetznerConfig() : null;
|
||||
|
||||
return (
|
||||
@@ -48,6 +50,14 @@ export default async function SettingsPage() {
|
||||
<HetznerConfigForm initialConfig={hetznerConfig} />
|
||||
</div>
|
||||
)}
|
||||
|
||||
{canManageTemplates && (
|
||||
<Card>
|
||||
<CardContent className="pt-6">
|
||||
<SketchTemplatesSection />
|
||||
</CardContent>
|
||||
</Card>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user