|
7 | 7 | import type { Models } from '@appwrite.io/console'; |
8 | 8 | import { diffDays } from '$lib/helpers/date'; |
9 | 9 | import DualTimeView from '$lib/components/dualTimeView.svelte'; |
10 | | - import { devKeyColumns, keyColumns, showDevKeysCreateModal } from '../store'; |
11 | | - import { Badge, Layout, Table } from '@appwrite.io/pink-svelte'; |
| 10 | + import { devKeyColumns, keyColumns } from '../store'; |
| 11 | + import { Button } from '$lib/elements/forms'; |
| 12 | + import { Badge, Card, Empty as EmptyState, Layout, Table } from '@appwrite.io/pink-svelte'; |
12 | 13 | import DeleteBatch from './deleteBatch.svelte'; |
13 | 14 | import { capitalize } from '$lib/helpers/string'; |
14 | 15 |
|
|
127 | 128 | {offset} |
128 | 129 | total={keys.total} /> |
129 | 130 | {/if} |
130 | | -{:else} |
| 131 | +{:else if isApiKey} |
131 | 132 | <Empty |
132 | 133 | single |
133 | 134 | allowCreate={$canWriteKeys} |
134 | 135 | href="https://appwrite.io/docs/advanced/platform/{slug}" |
135 | 136 | target="{label} key" |
136 | 137 | description={getDescription()} |
137 | 138 | on:click={async () => { |
138 | | - if (isApiKey) { |
139 | | - await goto( |
140 | | - `${base}/project-${page.params.region}-${page.params.project}/overview/${slug}/create` |
141 | | - ); |
142 | | - } else { |
143 | | - $showDevKeysCreateModal = true; |
144 | | - } |
| 139 | + await goto( |
| 140 | + `${base}/project-${page.params.region}-${page.params.project}/overview/${slug}/create` |
| 141 | + ); |
145 | 142 | }} /> |
| 143 | +{:else} |
| 144 | + <Card.Base padding="none"> |
| 145 | + <EmptyState title="No dev keys" description={getDescription()}> |
| 146 | + <svelte:fragment slot="actions"> |
| 147 | + <Button |
| 148 | + external |
| 149 | + href="https://appwrite.io/docs/advanced/platform/{slug}" |
| 150 | + text |
| 151 | + size="s" |
| 152 | + ariaLabel="dev keys documentation">Documentation</Button> |
| 153 | + </svelte:fragment> |
| 154 | + </EmptyState> |
| 155 | + </Card.Base> |
146 | 156 | {/if} |
147 | 157 |
|
148 | 158 | <DeleteBatch {keyType} bind:keyIds={selectedKeys} bind:showDelete={showDeleteModal} /> |
0 commit comments