Add empty state component
This commit is contained in:
1 parent
4e281b7b83
commit
6f75657a74
1 file changed
+24
@@ -0,0 +1,24 @@
|
||||
<script lang="ts">
|
||||
import type { Component, Snippet } from 'svelte';
|
||||
|
||||
let { icon: Icon, title, children }: { icon: Component<any>; title: string; children?: Snippet } = $props();
|
||||
</script>
|
||||
|
||||
<div class="empty">
|
||||
<div class="icon"><Icon size={28} strokeWidth={1.75} aria-hidden="true" /></div>
|
||||
<p class="title">{title}</p>
|
||||
{#if children}<div class="body">{@render children()}</div>{/if}
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.empty {
|
||||
display: flex; flex-direction: column; align-items: center; gap: var(--s2); text-align: center;
|
||||
padding: var(--s6) var(--s4); border: 1px dashed var(--border-strong); border-radius: var(--r-lg); color: var(--text-2);
|
||||
}
|
||||
.icon {
|
||||
display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
|
||||
background: var(--primary-soft); color: var(--primary-text); margin-bottom: var(--s1);
|
||||
}
|
||||
.title { font-weight: 700; color: var(--text); }
|
||||
.body { display: flex; flex-direction: column; align-items: center; gap: var(--s3); font-size: var(--fs-sm); max-width: 42ch; }
|
||||
</style>
|
||||
Reference in new issue
Block a user