Files
linumiq_net-web_app/app/layout.tsx
T
2026-05-29 17:07:00 +02:00

56 lines
1.5 KiB
TypeScript

import type { Metadata } from 'next';
import Link from 'next/link';
import './globals.css';
import { createSupabaseServerClient } from '@/lib/supabase/server';
export const metadata: Metadata = {
title: 'LinumIQ Tunnels',
description: 'Remote access tunnels for Home Assistant',
};
export const dynamic = 'force-dynamic';
export default async function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
const supabase = createSupabaseServerClient();
const {
data: { user },
} = await supabase.auth.getUser();
return (
<html lang="en">
<body>
<nav className="nav">
<Link href="/" style={{ color: 'var(--fg)', fontWeight: 600 }}>
LinumIQ Tunnels
</Link>
<div className="row">
{user ? (
<>
<Link href="/dashboard">Dashboard</Link>
<Link href="/billing">Billing</Link>
<form action="/api/auth/signout" method="post" style={{ margin: 0 }}>
<button className="secondary" type="submit">
Sign out
</button>
</form>
</>
) : (
<>
<Link href="/login">Login</Link>
<Link href="/signup" className="btn">
Sign up
</Link>
</>
)}
</div>
</nav>
<main className="container">{children}</main>
</body>
</html>
);
}