mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-28 16:02:47 +00:00
* fix(frontend): Before legacy code + add confirmation modal when removing a user + fix folder stats * fix(frontend): Add Date type narrowing * fix(frontend): Add missing fullscreen in ScriptEditorDrawer * fix(frontend): Check if we have un-saved changes before navigating to the homepage * fix(frontend): correctly use the keyed each * fix(frontend): add DateTimeInput * fix(frontend): add DateTimeInput * fix(frontend): add DateTimeInput * fix(frontend): code cleanup * fix(frontend): Set default time to 00:00
39 lines
893 B
Svelte
39 lines
893 B
Svelte
<script lang="ts">
|
|
import Cell from './table/Cell.svelte'
|
|
import DataTable from './table/DataTable.svelte'
|
|
import Head from './table/Head.svelte'
|
|
|
|
export let headers: string[] | undefined
|
|
export let data: any[] | undefined // Object containing the data
|
|
export let keys: string[]
|
|
</script>
|
|
|
|
<div class="mt-2">
|
|
<DataTable>
|
|
<Head>
|
|
<tr>
|
|
{#if headers}
|
|
{#each headers as header, i}
|
|
<Cell first={i == 0} last={i == headers.length - 1} head>{header}</Cell>
|
|
{/each}
|
|
{/if}
|
|
</tr>
|
|
</Head>
|
|
<tbody class="divide-y">
|
|
{#if data && keys && data.length > 0}
|
|
{#each data as row}
|
|
<tr>
|
|
{#each keys as key, i}
|
|
<Cell first={i == 0} last={i == keys.length - 1} class="w-1/3 whitespace-pre-wrap">
|
|
{row[key] ?? ''}
|
|
</Cell>
|
|
{/each}
|
|
</tr>
|
|
{/each}
|
|
{:else}
|
|
<tr>Loading...</tr>
|
|
{/if}
|
|
</tbody>
|
|
</DataTable>
|
|
</div>
|