fix: missing empty list placeholder
This commit is contained in:
parent
456131602f
commit
2f0fd05d35
@ -2,7 +2,7 @@
|
|||||||
import { Button } from 'bits-ui';
|
import { Button } from 'bits-ui';
|
||||||
import IconPlus from '~icons/tabler/plus';
|
import IconPlus from '~icons/tabler/plus';
|
||||||
|
|
||||||
let { createHref = null, msgAdd = '', children } = $props();
|
let { createHref = null, msgAdd = '', empty = false, children } = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if createHref}
|
{#if createHref}
|
||||||
@ -21,7 +21,8 @@
|
|||||||
<div class="w-full sm:px-6 px-3 py-4 max-w-3xl mx-auto">
|
<div class="w-full sm:px-6 px-3 py-4 max-w-3xl mx-auto">
|
||||||
{#if children}
|
{#if children}
|
||||||
{@render children?.()}
|
{@render children?.()}
|
||||||
{:else}
|
{/if}
|
||||||
|
{#if empty}
|
||||||
<div class="p-4 text-center text-neutral-700">
|
<div class="p-4 text-center text-neutral-700">
|
||||||
<p>Nothing here.</p>
|
<p>Nothing here.</p>
|
||||||
{#if createHref}
|
{#if createHref}
|
||||||
|
|||||||
@ -28,7 +28,11 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ListPage createHref={data.user.admin ? '/dash/devices/new' : null} msgAdd="Add Device">
|
<ListPage
|
||||||
|
createHref={data.user.admin ? '/dash/devices/new' : null}
|
||||||
|
empty={data.devices.length == 0}
|
||||||
|
msgAdd="Add Device"
|
||||||
|
>
|
||||||
<div class="flex gap-4 flex-wrap justify-center">
|
<div class="flex gap-4 flex-wrap justify-center">
|
||||||
{#each data.devices as device}
|
{#each data.devices as device}
|
||||||
<ResCard
|
<ResCard
|
||||||
|
|||||||
@ -8,7 +8,11 @@
|
|||||||
store.pageTitle = 'Listing all groups';
|
store.pageTitle = 'Listing all groups';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ListPage createHref={data.user.admin ? '/dash/groups/new' : null} msgAdd="Add Group">
|
<ListPage
|
||||||
|
createHref={data.user.admin ? '/dash/groups/new' : null}
|
||||||
|
empty={data.groups.length == 0}
|
||||||
|
msgAdd="Add Group"
|
||||||
|
>
|
||||||
<div class="flex gap-4 flex-wrap justify-center">
|
<div class="flex gap-4 flex-wrap justify-center">
|
||||||
{#each data.groups as group}
|
{#each data.groups as group}
|
||||||
<ResCard
|
<ResCard
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user