tremor-tracker/src/app/layout.tsx

44 lines
1.0 KiB
TypeScript
Raw Normal View History

2025-04-28 19:03:29 +01:00
"use client";
2025-02-24 12:37:15 +00:00
import type { Metadata } from "next";
import "./globals.css";
2025-04-28 19:03:29 +01:00
import { action, createStore, StoreProvider } from "easy-peasy";
import { Inter } from "next/font/google";
import { StoreModel } from "@appTypes/StoreModel";
import Navbar from "@components/Navbar";
2025-03-19 19:20:18 +00:00
const inter = Inter({
2025-04-28 19:03:29 +01:00
subsets: ["latin"],
variable: "--font-inter",
2025-02-24 12:37:15 +00:00
});
2025-04-28 19:03:29 +01:00
const store = createStore<StoreModel>({
currency: {
selectedCurrency: "GBP",
setSelectedCurrency: action((state, payload) => {
state.selectedCurrency = payload;
}),
currencies: ["GBP", "USD", "EUR"],
conversionRates: { GBP: 1, USD: 1.33, EUR: 1.17 },
tickers: { GBP: "£", USD: "$", EUR: "€" },
},
});
2025-02-24 12:37:15 +00:00
export default function RootLayout({
2025-04-28 19:03:29 +01:00
children,
2025-02-24 12:37:15 +00:00
}: Readonly<{
2025-04-28 19:03:29 +01:00
children: React.ReactNode;
2025-02-24 12:37:15 +00:00
}>) {
2025-04-28 19:03:29 +01:00
return (
<html lang="en">
<StoreProvider store={store}>
<body className={`${inter.variable} h-[calc(100vh-3.5rem)] flex flex-col min-h-screen antialiased`}>
<Navbar></Navbar>
<div className="flex-1 overflow-y-auto">{children}</div>
</body>
</StoreProvider>
</html>
);
2025-02-24 12:37:15 +00:00
}