35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
import { getTranslations } from "next-intl/server";
|
|
import { Image } from "lucide-react";
|
|
import { FaviconForm } from "./favicon-form";
|
|
import { prisma } from "@/lib/prisma";
|
|
|
|
export const dynamic = "force-dynamic";
|
|
|
|
export default async function AdminFaviconPage() {
|
|
const t = await getTranslations("pages.admin.favicon");
|
|
|
|
let faviconUrl: string | null = null;
|
|
try {
|
|
const setting = await prisma.websiteSetting.findUnique({ where: { key: "cms_favicon" } });
|
|
faviconUrl = setting?.value ?? null;
|
|
} catch {
|
|
faviconUrl = null;
|
|
}
|
|
|
|
return (
|
|
<main>
|
|
<div className="flex items-center gap-3 mb-6">
|
|
<div className="w-10 h-10 rounded-xl bg-gradient-to-br from-[var(--color-primary)]/20 to-[var(--color-primary)]/5 grid place-items-center">
|
|
<Image size={20} className="text-[var(--color-primary)]" />
|
|
</div>
|
|
<div>
|
|
<h1 className="m-0 text-xl font-extrabold text-[var(--color-text)]">{t("title")}</h1>
|
|
<p className="m-0 text-xs text-[var(--color-text-muted)] mt-0.5">{t("subtitle")}</p>
|
|
</div>
|
|
</div>
|
|
|
|
<FaviconForm currentUrl={faviconUrl} />
|
|
</main>
|
|
);
|
|
}
|