<script lang="ts">
	import Payments from "$lib/components/Payments.svelte";
	import { nowStore } from "$lib/store/nowStore";
	import { lastMonthPaymentsStore } from "$lib/store/lastMonthPaymentsStore";
	import { thisMonthPaymentsStore } from "$lib/store/thisMonthPaymentsStore";

	const thisMonth = new Date();
	thisMonth.setMonth($nowStore.getMonth());
	const previousMonth = new Date();
	previousMonth.setMonth($nowStore.getMonth() - 1);
</script>

<template>
	<div class="grid grid-cols-2">
		<Payments date={previousMonth} payments={$lastMonthPaymentsStore} />
		<Payments date={thisMonth} payments={$thisMonthPaymentsStore} />
	</div>
</template>
