aboutsummaryrefslogtreecommitdiff
path: root/src/components/Post.astro
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/Post.astro')
-rw-r--r--src/components/Post.astro28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/components/Post.astro b/src/components/Post.astro
new file mode 100644
index 0000000..6805846
--- /dev/null
+++ b/src/components/Post.astro
@@ -0,0 +1,28 @@
+---
+import { creatorColor, formatTime } from '../lib/util';
+
+export interface Props {
+ id: string;
+ date: number;
+ creator: string;
+ box: string;
+ board: string
+}
+
+const { id, date, creator, box, board = '' } = Astro.props;
+---
+<div class={box} id={id}>
+ <span style="line-height: 2rem;">
+ {(board != '') ? (
+ <a href=`/board/${board}/${id}` style="font-family: mono">{id}</a>
+ ) : (
+ <span style="font=family: mono">{id}</span>
+ )}
+
+ at {formatTime(date)} <br>
+ -> <span style=`${creatorColor(creator)}; font-family: mono`>
+ {creator}
+ </span> <br>
+ </span> <hr>
+ <slot />
+</div>