Added await
This commit is contained in:
parent
ca09aa0fd5
commit
e031673e9c
|
@ -33,26 +33,46 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody class="bg-white dark:bg-gray-700 divide-y divide-gray-200 dark:text-gray-100" x-max="1">
|
||||
{#each urls as url}
|
||||
{#await urlQuery}
|
||||
<tr>
|
||||
<td
|
||||
class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900 dark:text-gray-200"
|
||||
>
|
||||
{url.shortcode}
|
||||
Loading data...
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm">
|
||||
<a href={url.target}>{url.target}</a>
|
||||
<a href="#">Loading data...</a>
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm"> {url.visits} </td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm"> Loading data... </td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
|
||||
<button
|
||||
on:click={deleteUrl(url.shortcode)}
|
||||
class="text-indigo-600 dark:text-red-600 hover:text-indigo-900 dark:hover:text-red-900"
|
||||
>Delete</button
|
||||
>
|
||||
</td>
|
||||
</tr>
|
||||
{/each}
|
||||
{:then}
|
||||
{#each urls as url}
|
||||
<tr>
|
||||
<td
|
||||
class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900 dark:text-gray-200"
|
||||
>
|
||||
{url.shortcode}
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm">
|
||||
<a href={url.target}>{url.target}</a>
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm"> {url.visits} </td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
|
||||
<button
|
||||
on:click={deleteUrl(url.shortcode)}
|
||||
class="text-indigo-600 dark:text-red-600 hover:text-indigo-900 dark:hover:text-red-900"
|
||||
>Delete</button
|
||||
>
|
||||
</td>
|
||||
</tr>
|
||||
{/each}
|
||||
{/await}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue