/* ============================================================
   KODILA — Šifranti
   ============================================================ */

const SIFRANTI_MODULES = [
  { id: 'drzave', label: 'Države' },
  { id: 'valute', label: 'Valute' },
];

function Sifranti({ currentUser }) {
  const [tab, setTab] = useState(SIFRANTI_MODULES[0].id);

  return (
    <div className="page">
      <div className="page-head">
        <div className="grow">
          <div className="crumbs">
            <span>Intranet</span>
            <span className="sep" dangerouslySetInnerHTML={{ __html: I('chevright', 13) }} />
            <span>Šifranti</span>
          </div>
          <h1 className="h-page">Šifranti</h1>
        </div>
      </div>

      <div className="seg" style={{ marginBottom: 16 }}>
        {SIFRANTI_MODULES.map(m => (
          <button key={m.id} className={tab === m.id ? 'active' : ''} onClick={() => setTab(m.id)}>{m.label}</button>
        ))}
      </div>

      {tab === 'drzave' && <Drzave currentUser={currentUser} />}
      {tab === 'valute' && <Valute currentUser={currentUser} />}
    </div>
  );
}
Object.assign(window, { Sifranti });
