reveil/ui/src/routes/musiks/tracks/[tid]/+page.svelte

42 lines
1.1 KiB
Svelte
Raw Normal View History

2022-10-04 10:29:50 +00:00
<script>
2022-10-15 09:12:51 +00:00
import { goto } from '$app/navigation';
2022-10-04 10:29:50 +00:00
import { page } from '$app/stores';
import {
Container,
2022-10-15 09:12:51 +00:00
Icon,
2022-10-04 10:29:50 +00:00
Input,
ListGroup,
ListGroupItem,
Spinner,
} from 'sveltestrap';
2022-10-15 09:12:51 +00:00
import { getTrack } from '$lib/track';
2022-10-04 10:29:50 +00:00
</script>
{#await getTrack($page.params.tid)}
<div class="d-flex flex-fill justify-content-center align-items-center gap-2">
<Spinner color="primary" /> Chargement en cours&hellip;
</div>
{:then track}
<Container>
<h2>
{track.name}
</h2>
<ListGroup>
<ListGroupItem>
<strong>Chemin</strong>
{track.path}
</ListGroupItem>
<ListGroupItem class="d-flex gap-2">
<strong>Active&nbsp;?</strong>
<Input type="switch" on:change={() => track.toggleEnable()} checked={track.enabled} />
</ListGroupItem>
<ListGroupItem>
<strong>ID</strong>
<span class="text-muted">{track.id}</span>
</ListGroupItem>
</ListGroup>
</Container>
{/await}