<!-- This Source Code Form is subject to the terms of the Mozilla Public
   - License, v. 2.0. If a copy of the MPL was not distributed with this
   - file, You can obtain one at https://mozilla.org/MPL/2.0/. -->

<script lang="ts">
	import { type Entry } from '$lib/entry';
	import OverviewEntry from './utils/OverviewEntry.svelte';

	export let latest: Entry[];
	export let past: Entry[];
</script>

<div class="w-full rounded-lg border border-gray-200 p-6 shadow">
	<h2 class="text-xl">Latest activity</h2>
	<div class="pt-2">
		{#each latest as entry (entry.id)}
			<OverviewEntry {entry} />
		{/each}
	</div>
</div>
{#if past.length > 0}
	<div class="w-full rounded-lg border border-gray-200 p-6 shadow">
		<h2 class="text-xl">Memories from the past</h2>
		<div class="pt-2">
			{#each past as entry (entry.id)}
				<OverviewEntry {entry} showDate={true} />
			{/each}
		</div>
	</div>
{/if}