mirror of
https://github.com/anotherhadi/iknowyou.git
synced 2026-04-12 00:47:26 +02:00
init
This commit is contained in:
24
front/src/components/DemoBanner.svelte
Normal file
24
front/src/components/DemoBanner.svelte
Normal file
@@ -0,0 +1,24 @@
|
||||
<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}
|
||||
Reference in New Issue
Block a user