aboutsummaryrefslogtreecommitdiff
path: root/src/components/Post.astro
blob: 68058461d97d448860716eb3c62aa86fed8ac401 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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>