Files
windmill/frontend/src/lib/components/TableCustom.svelte
T
Faton Ramadani b39f486c91 Dark mode v0 (#1893)
* feat(frontend): wip

* wip

* wip

* wip

* wip

* add toggle

* correctly handle monaco theme

* wip

* wip

* wip

* wip

* wip

* feat(frontend): Dark mode v0

* feat(frontend): Adap AI gen poppup

* feat(frontend): Adap script metadata labels

* feat(frontend): Fix unreadable texts

* feat(frontend): Fix unreadable texts

* feat(frontend): Fix unreadable texts

* feat(frontend): Fix ressource picker

* feat(frontend): Fix unreadable texts

* feat(frontend): Fix unreadable texts

* feat(frontend): Fix unreadable texts

* feat(frontend): Add theme toggle in the login page

* feat(frontend): Fix unreadable texts

* feat(frontend): Fix language selection

* feat(frontend): Fix FlowStatusViewer colors

* feat(frontend): Fix divide colors

* feat(frontend): Fix flow graph buttons

* feat(frontend): add theme toggle in login modal

* feat(frontend): small ui fix

* feat(frontend): fix graph dark mode toggle
2023-07-25 10:43:04 +02:00

41 lines
1.0 KiB
Svelte

<script lang="ts">
import { createEventDispatcher } from 'svelte'
export let paginated = false
export let currentPage = 1
export let showNext = true
const dispatch = createEventDispatcher()
</script>
<!-- A custom table
- the first slot should be a <tr>, containing th elements
- the second slot should be a <tbody>, containing th elements
-->
<div class="flex flex-col {$$props.class} min-w-full">
<div class="inline-block min-w-full py-2 align-middle">
<table class="table-custom min-w-full table-auto divide-y">
<thead>
<slot name="header-row" />
</thead>
<slot name="body" />
</table>
</div>
{#if paginated}
<div class="sticky flex flex-row-reverse text-tertiary mb-6">
<button
class="ml-2 drop-shadow-md {showNext ? 'visible' : 'invisible'}"
on:click={() => dispatch('next')}
>
Next
</button>
<button
class="mx-2 drop-shadow-md {currentPage === 1 ? 'hidden' : ''}"
on:click={() => dispatch('previous')}
>
Previous
</button>
</div>
{/if}
</div>