+ {t.annuncio_load_fail.titolo} +
+{t.annuncio_load_fail.sottotitolo}
+diff --git a/apps/infoalloggi/src/_app/layout.tsx b/apps/infoalloggi/src/_app/layout.tsx new file mode 100644 index 0000000..fea34bf --- /dev/null +++ b/apps/infoalloggi/src/_app/layout.tsx @@ -0,0 +1,39 @@ +import type { Metadata } from "next"; +import "~/styles/globals.css"; +export const metadata: Metadata = { + title: "Home", + description: "Welcome to Next.js", + icons: { + apple: { + url: "/favicon/apple-touch-icon.png", + sizes: "180x180", + type: "image/png", + }, + icon: [ + { url: "/favicon/favicon-32x32.png", sizes: "32x32", type: "image/png" }, + { url: "/favicon/favicon-16x16.png", sizes: "16x16", type: "image/png" }, + ], + other: [ + { + rel: "mask-icon", + url: "/favicon/safari-pinned-tab.svg", + color: "#5bbad5", + }, + ], + }, + manifest: "/site.webmanifest", +}; + +export default function RootLayout({ + // Layouts must accept a children prop. + // This will be populated with nested layouts or pages + children, +}: { + children: React.ReactNode; +}) { + return ( + +
{children} + + ); +} diff --git a/apps/infoalloggi/src/_app/lib/annunci.ts b/apps/infoalloggi/src/_app/lib/annunci.ts new file mode 100644 index 0000000..bfae57f --- /dev/null +++ b/apps/infoalloggi/src/_app/lib/annunci.ts @@ -0,0 +1,20 @@ +import TipologiaPosizioneEnum from "~/schemas/public/TipologiaPosizioneEnum"; +import { db } from "~/server/db"; + +export async function getDataFromDB() { + try { + // Example query - adjust to your database schema + const data = await db + .selectFrom("annunci") + .select("codice") + .where("web", "=", true) + .where("tipo", "=", TipologiaPosizioneEnum.Transitorio) + .where("stato", "=", "Attivo") + .execute(); + + return data; + } catch (error) { + console.error("Database error:", error); + return []; + } +} diff --git a/apps/infoalloggi/src/_app/testapp/page.tsx b/apps/infoalloggi/src/_app/testapp/page.tsx new file mode 100644 index 0000000..a636b18 --- /dev/null +++ b/apps/infoalloggi/src/_app/testapp/page.tsx @@ -0,0 +1,22 @@ +import { Suspense } from "react"; +import Annunci from "~/app/ui/annunci"; +import { getDataFromDB } from "~/app/lib/annunci"; +import { LoadingPage } from "~/components/loading"; + +export default function TestAppPage() { + const annunci = getDataFromDB(); + + return ( +{t.annuncio_load_fail.sottotitolo}
+{t.annuncio_load_fail.sottotitolo}
-