---
import type { Locale } from '../i18n';
import { t } from '../i18n';

interface Props {
  locale: Locale;
}

const { locale } = Astro.props;
const s = t(locale).banner;
---

<div id="operator-banner" class="operator-banner" hidden>
  <div class="operator-banner-text">
    <strong>{s.heading}</strong> {s.body}
  </div>
  <div class="operator-banner-actions">
    <a href="/controlplane/">{s.openControlplane}</a>
    <a href="https://docs.clawdie.si/">{s.readDocs}</a>
    <a href="https://docs.clawdie.si/operate/public-domain/">{s.claimDomain}</a>
  </div>
</div>

<script is:inline>
  (function () {
    if (typeof window === 'undefined') return;
    if (window.location.hostname === 'clawdie.si') return;
    var el = document.getElementById('operator-banner');
    if (el) el.hidden = false;
  })();
</script>
