Initial commit

This commit is contained in:
michaeltieso
2025-12-01 14:49:17 +00:00
commit 3480888eaa
92 changed files with 16631 additions and 0 deletions

53
app/layout.tsx Normal file
View File

@@ -0,0 +1,53 @@
import type { Metadata } from "next";
import "./globals.css";
import { AuthProvider } from "@/lib/auth-context";
import { ThemeProvider } from "@/components/theme-provider";
import { db, settings } from "@/lib/db";
import { eq } from "drizzle-orm";
async function getSettings() {
try {
const allSettings = await db.select().from(settings);
const settingsObj = allSettings.reduce((acc, setting) => {
acc[setting.key] = setting.value;
return acc;
}, {} as Record<string, string>);
return {
siteTitle: settingsObj.siteTitle || 'Wishlist',
homepageSubtext: settingsObj.homepageSubtext || 'Browse and explore available wishlists',
};
} catch (error) {
return {
siteTitle: 'Wishlist',
homepageSubtext: 'Browse and explore available wishlists',
};
}
}
export async function generateMetadata(): Promise<Metadata> {
const settings = await getSettings();
return {
title: settings.siteTitle,
description: "Self-hosted wishlist application for families",
icons: {
icon: '/icon.svg',
},
};
}
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body className="font-sans antialiased bg-gray-50 dark:bg-gray-900">
<AuthProvider>
<ThemeProvider>{children}</ThemeProvider>
</AuthProvider>
</body>
</html>
);
}