---
import BaseLayout from './BaseLayout.astro';
import '../styles/achizitii.css';

interface Props {
  title: string;
  description?: string;
  ogImage?: string;
  active?: 'azi' | 'cauta' | 'top-contracte' | 'top-firme' | 'fonduri-ue' | 'risc' | 'explorer' | 'retete' | 'red-flags' | 'investigation' | null;
}

const { title, description, ogImage, active = null } = Astro.props;

const links = [
  { href: '/azi',           label: 'Azi',           key: 'azi' },
  { href: '/cauta',         label: 'Caută',         key: 'cauta' },
  { href: '/retete',        label: 'Rețete',        key: 'retete' },
  { href: '/investigation', label: 'Investigații',  key: 'investigation' },
  { href: '/top-contracte', label: 'Top contracte', key: 'top-contracte' },
  { href: '/top-firme',     label: 'Top firme',     key: 'top-firme' },
  { href: '/fonduri-ue',    label: 'Fonduri UE',    key: 'fonduri-ue' },
  { href: '/risc',          label: 'Risc',          key: 'risc' },
  { href: '/red-flags',     label: '🚩 Red flags',   key: 'red-flags' },
  { href: '/explorer',      label: 'Explorer',      key: 'explorer' },
];
---
<BaseLayout title={title} description={description} ogImage={ogImage}>
  <div class="achizitii-app">
    <nav class="achizitii-subnav">
      <div class="achizitii-subnav-inner">
        <a href="/" class="achizitii-subnav-brand">
          vreau.digital
        </a>
        {links.map((l) => (
          <a href={l.href} class={active === l.key ? 'is-active' : ''}>{l.label}</a>
        ))}
        <span class="achizitii-subnav-spacer" />
        <a href="https://vreaudigital.ro" class="achizitii-subnav-back" target="_blank" rel="noopener">↗ vreaudigital.ro</a>
      </div>
    </nav>
    <slot />
  </div>
</BaseLayout>
