Handle routines

This commit is contained in:
nemunaire 2022-10-04 18:34:37 +02:00
commit 392d0133f7
8 changed files with 338 additions and 40 deletions

View file

@ -3,10 +3,13 @@
Card,
Col,
Container,
Row,
Icon,
Row,
Spinner,
} from 'sveltestrap';
import { routines } from '../../stores/routines';
import CardRoutine from '../../components/CardRoutine.svelte';
import ActionList from '../../components/ActionList.svelte';
</script>
@ -16,7 +19,19 @@
<Col md="8">
<Row cols={{xs: 1, lg: 2, xl: 3}}>
<Col class="mb-4">
<CardRoutine />
{#if $routines.list}
{#each $routines.list as routine (routine.id)}
<CardRoutine {routine} />
{/each}
{:else}
{#await routines.refresh()}
<div class="d-flex justify-content-center align-items-center gap-2">
<Spinner color="primary" /> Chargement en cours&hellip;
</div>
{:then}
test
{/await}
{/if}
</Col>
<Col class="mb-4">
<Card