Files
lucent-laravel/front/js/entry/HomeEntry/HomeEntry.svelte
T

37 lines
1.2 KiB
Svelte
Raw Normal View History

2026-01-07 21:42:18 +02:00
<script>
import { getContext, onMount } from "svelte";
import RecordRow from "./RecordRow.svelte";
import ChannelLayout from "../../layouts/ChannelLayout.svelte";
import { get } from "../../modules/remote";
2026-01-08 18:50:32 +02:00
let { channel, user, data } = $props();
2026-01-07 21:42:18 +02:00
let records = $state([]);
let graph = $state(null);
let users = $state([]);
onMount(() => {
get(channel.lucentUrl + "/home/records", {}, (data) => {
records = data.records;
graph = data.graph;
users = data.users;
});
});
</script>
2026-01-08 18:50:32 +02:00
<ChannelLayout {body} {channel} schemas={data.schemas} {user}></ChannelLayout>
2026-01-07 21:42:18 +02:00
{#snippet body()}
<h3 class="header-small mb-4 mt-5">Latest Content changes</h3>
{#if records.length > 0}
<div class="table">
<table class="">
<tbody>
{#each records as record (record.id)}
<tr>
<RecordRow {channel} {graph} {record} {users}
></RecordRow>
</tr>
{/each}
</tbody>
</table>
</div>
{/if}
{/snippet}