<script>
  import { FlaskConical } from "@lucide/svelte";

  let demo = $state(false);

  async function checkDemo() {
    try {
      const res = await fetch("/api/config");
      if (res.ok) {
        const data = await res.json();
        demo = data.demo === true;
      }
    } catch (_) {}
  }

  checkDemo();
</script>

{#if demo}
  <div class="w-full bg-warning/15 border-b border-warning/30 py-1.5 px-4 flex items-center justify-center gap-2 text-xs text-warning">
    <FlaskConical size={13} class="shrink-0" />
    <span>Demo mode — searches and configuration changes are disabled</span>
  </div>
{/if}
