Skip to content

Commit

Permalink
ui: kanban no record ui
Browse files Browse the repository at this point in the history
  • Loading branch information
nichenqin committed Sep 10, 2024
1 parent e18c01a commit 7f96d17
Showing 1 changed file with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,22 @@
)}
>
{#if !readonly && $hasPermission("record:create")}
<Button on:click={onCreateRecord} variant="outline" size="sm" class="w-full">
<PlusIcon class="text-muted-foreground mr-2 h-4 w-4 font-semibold" />
</Button>
{#if $query.isFetchedAfterMount}
{#if $query.data?.pages[0]?.total > 0}
<Button on:click={onCreateRecord} variant="outline" size="sm" class="w-full">
<PlusIcon class="text-muted-foreground mr-2 h-4 w-4 font-semibold" />
</Button>
{:else}
<div class="flex h-full w-full flex-col items-center justify-center space-y-3">
<p class="text-sm font-semibold">No records</p>
<p class="text-muted-foreground text-xs">Create a new record of this option <Option option={option ?? {id: '', name: 'No Option', color: 'gray'}} /></p>
<Button on:click={onCreateRecord} variant="outline" size="sm" >
<PlusIcon class="text-muted-foreground mr-2 h-4 w-4 font-semibold" />
New Record
</Button>
</div>
{/if}
{/if}
{/if}
{#if $query.isLoading}
<KanbanSkeleton />
Expand Down

0 comments on commit 7f96d17

Please sign in to comment.