25 lines
666 B
Svelte
25 lines
666 B
Svelte
<script lang="ts">
|
|
import type { Comment } from '../guestbook.svelte';
|
|
export let comment: Comment;
|
|
</script>
|
|
|
|
<div class="rounded bg-red-100 mt-2 break-words">
|
|
<div class="rounded-t bg-slate-400 grid grid-cols-2 gap-1 min-h-fit px-3 py-1">
|
|
<p class="text-xs">Author: {comment.name}</p>
|
|
<p class="text-xs">
|
|
Time:
|
|
{#if comment.time != null}
|
|
{new Date(comment.time).toLocaleString('en-US', {dateStyle: 'long', timeStyle: 'short'})}
|
|
{:else}
|
|
brokn
|
|
{/if}
|
|
</p>
|
|
{#if comment.website != null}
|
|
<p class="text-xs col-span-2">Site: {comment.website}</p>
|
|
{/if}
|
|
</div>
|
|
<div class="px-3 ">
|
|
<p class="">{comment.message}</p>
|
|
</div>
|
|
</div>
|