Files
Umbrella/frontend/src/Components/Item.svelte
2025-11-24 12:49:24 +01:00

27 lines
649 B
Svelte

<script>
import { t } from '../translations.svelte';
let { item, onclick } = $props();
</script>
<fieldset {onclick}>
<legend>{item.code} | {item.name}</legend>
{#if item.properties}
<table>
<tbody>
{#if item.location.name}
<tr>
<th>{t('location')}</th>
<td>{item.location.name}</td>
</tr>
{/if}
{#each Object.entries(item.properties) as [idx,prop]}
<tr>
<th>{prop.name}</th>
<td>{prop.value} {prop.unit}</td>
</tr>
{/each}
</tbody>
</table>
{/if}
</fieldset>