Initial commit: Hoomat storefront with Meshkee API and static-image slots.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
import type { Metadata } from "next";
|
||||
import "./globals.css";
|
||||
import { SiteShell } from "@/app/components/site-shell";
|
||||
import { getCategories, getFavicon } from "@/lib/meshkee/api";
|
||||
import { site } from "@/lib/site-data";
|
||||
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
let icon = site.logo;
|
||||
try {
|
||||
const favicon = await getFavicon();
|
||||
if (favicon.faviconUrl) icon = favicon.faviconUrl;
|
||||
} catch {
|
||||
// keep default local logo
|
||||
}
|
||||
|
||||
return {
|
||||
title: site.title,
|
||||
description: site.description,
|
||||
icons: [{ url: icon }],
|
||||
};
|
||||
}
|
||||
|
||||
export default async function RootLayout({
|
||||
children,
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
const categories = await getCategories("product").catch(() => []);
|
||||
|
||||
return (
|
||||
<html lang="fa" dir="rtl">
|
||||
<body>
|
||||
<SiteShell categories={categories}>{children}</SiteShell>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user