|
3 | 3 | import { getUserActions } from "$lib/services/database/actions"; |
4 | 4 | import { getQuestionsByCategory } from "$lib/services/database/questions"; |
5 | 5 | import { getContext } from 'svelte'; |
6 | | -
|
| 6 | + import ListItem from "$lib/components/cards/ListItem.svelte"; |
| 7 | + |
7 | 8 | const setView = getContext<(view:View) => void>('setView'); |
8 | 9 |
|
9 | 10 | const getList = getContext<() => ListCategory>('getList'); |
|
23 | 24 | const onListClick = () => { setView("detail") }; |
24 | 25 | </script> |
25 | 26 |
|
26 | | -<div class="dev"> |
27 | | - <div id="list-header" class="dev flex flex-row justify-between"> |
28 | | - <h2 class="dev">List View</h2> |
| 27 | +<div class="dev dev-div"> |
| 28 | + <div id="list-header" class="dev dev-div flex flex-row justify-between"> |
| 29 | + <h2 class="dev dev-div">List View</h2> |
29 | 30 |
|
30 | | - <button onclick={onBackClick} class="dev button"> |
| 31 | + <button onclick={onBackClick} class="dev dev-div dev-button"> |
31 | 32 | Back |
32 | 33 | </button> |
33 | 34 | </div> |
34 | 35 |
|
35 | | - <div id="list-items" class="dev flex flex-col justify-left"> |
| 36 | + <div id="list-items" class="dev dev-div flex flex-col justify-left"> |
36 | 37 | {#if list.raw == "actions"} |
37 | 38 | {#await queryActions} |
38 | 39 | <p>Loading...</p> |
39 | 40 | {:then result} |
40 | 41 | {#if result.data} |
41 | 42 | {#each result.data as action} |
42 | | - <button onclick={onListClick} class="dev list"> |
| 43 | + <button onclick={onListClick} class="dev dev-div dev-list"> |
43 | 44 | {action.description} |
44 | 45 | </button> |
45 | 46 | {/each} |
|
53 | 54 | {:then result} |
54 | 55 | {#if result.data} |
55 | 56 | {#each result.data as question} |
56 | | - <button onclick={onListClick} class="dev list"> |
57 | | - {question.preview} |
58 | | - </button> |
| 57 | + <ListItem {question} /> |
59 | 58 | {/each} |
60 | 59 | {/if} |
61 | 60 | {:catch error} |
62 | 61 | <p>Error: {error.message}</p> |
63 | 62 | {/await} |
64 | 63 | {:else} |
65 | | - <div class="dev list"> |
| 64 | + <div class="dev dev-div dev-list"> |
66 | 65 | <p>No list selected</p> |
67 | 66 | </div> |
68 | 67 | {/if} |
|
0 commit comments