← back to Professional Directory
agents/web-agent/app/layout.tsx
42 lines
import type { Metadata } from 'next';
import './globals.css';
export const metadata: Metadata = {
title: { default: 'drvouch — find a doctor your community vouches for', template: '%s · drvouch' },
description: 'Patient-vouched LA doctors, dentists, optometrists, and care providers. Real reviews, real ratings, no algorithm games.',
openGraph: { type: 'website', siteName: 'drvouch' },
};
const themeBootstrap = `(function(){try{var t=localStorage.getItem('theme');if(!t){t=window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light';}document.documentElement.setAttribute('data-theme',t);}catch(e){}})();`;
const themeToggleScript = `(function(){var b=document.getElementById('theme-toggle');if(!b)return;function s(){var t=document.documentElement.getAttribute('data-theme');b.setAttribute('aria-pressed',t==='dark'?'true':'false');}s();b.addEventListener('click',function(){var c=document.documentElement.getAttribute('data-theme')||'light';var n=c==='dark'?'light':'dark';document.documentElement.setAttribute('data-theme',n);try{localStorage.setItem('theme',n);}catch(e){}s();});})();`;
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<head>
<script dangerouslySetInnerHTML={{ __html: themeBootstrap }} />
</head>
<body>
<header className="site-header">
<a href="/" className="brand">drvouch<span className="brand-dot">.</span></a>
<nav className="primary-nav">
<a href="/search">Search</a>
<a href="/community">Community</a>
<a href="/account">Account</a>
<button type="button" id="theme-toggle" className="theme-toggle" aria-label="Toggle dark mode" aria-pressed="false" title="Toggle dark / light">
<svg className="icon-sun" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"/></svg>
<svg className="icon-moon" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M21 12.79A9 9 0 1 1 11.21 3a7 7 0 0 0 9.79 9.79z"/></svg>
</button>
</nav>
</header>
<main>{children}</main>
<footer className="site-footer">
<span>© drvouch — patient-vouched LA healthcare</span>
<span className="muted">Not medical advice. For clinical questions, call the office.</span>
</footer>
<script dangerouslySetInnerHTML={{ __html: themeToggleScript }} />
</body>
</html>
);
}