-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create AssetList component which isolates dynamic content
- Loading branch information
Showing
2 changed files
with
23 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<script lang="ts"> | ||
import { type AssetData } from "$src/types"; | ||
import AssetBox from "$src/lib/AssetBox.svelte"; | ||
import { loadRHInventoryAssetData } from '$src/lib/rhinventory_api'; | ||
let props: { assetTagId: number } = $props(); | ||
let assetPage = $state(0); | ||
let assetsPromise: Promise<AssetData[]> = $derived(loadRHInventoryAssetData({tagId: props.assetTagId, page: assetPage})) | ||
</script> | ||
|
||
{#await assetsPromise } | ||
<p><em>Načítá se...</em></p> | ||
{:then assets} | ||
{#each assets as asset } | ||
<AssetBox data={asset} /> | ||
{/each} | ||
{:catch error} | ||
<p><em>Chyba při načítání předmětů: {error.message}</em></p> | ||
{/await} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters