<script module lang="ts">
	import type { commit } from "./+page.server.ts";
	import "./card.scss";
	export { commitCard };
</script>

{#snippet commitCard(commit: commit)}
	{#if commit.additions}
		<tr class="boxedUp field">
			<th scope="row" class="boxedUp field">
				{commit.hash}
			</th>
			<th class="boxedUp field">
				{commit.title}
			</th>
			<th class="boxedUp field">
				{commit.date.getDate()}/{commit.date.getUTCMonth()}/{commit.date.getUTCFullYear()}
				- {#if commit.date.getUTCHours() < 10}0{/if}{commit.date.getHours()}:{#if commit.date.getUTCMinutes() < 10}0{/if}{commit.date
					.getUTCMinutes()
					.toString()}
			</th>
			<th class="boxedUp additions">
				+{commit.additions}
			</th>
			<th class="boxedUp deletions">
				-{commit.deletions}
			</th>
		</tr>
	{/if}
{/snippet}
