add post reaction timeline
This commit is contained in:
parent
5aeed54b20
commit
7ecea242f2
2 changed files with 36 additions and 3 deletions
31
src/app/feed/components/PostTimeline.tsx
Normal file
31
src/app/feed/components/PostTimeline.tsx
Normal file
|
@ -0,0 +1,31 @@
|
|||
import { PostReaction } from '../posts/posts.ts'
|
||||
import { Temporal } from '@js-temporal/polyfill'
|
||||
|
||||
interface PostTimelineProps {
|
||||
reactions: PostReaction[]
|
||||
}
|
||||
|
||||
export function PostTimeline({ reactions }: PostTimelineProps) {
|
||||
return (
|
||||
<div className={`flex flex-col gap-4 mb-4 px-4`}>
|
||||
{reactions.map((reaction) => (
|
||||
<div className={`flex flex-col`}>
|
||||
<div className={`text-gray-400 text-xs -mb-1`}>
|
||||
{Temporal.Now.instant().toLocaleString('en-AU', {
|
||||
year: 'numeric',
|
||||
month: 'numeric',
|
||||
day: 'numeric',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
})}
|
||||
</div>
|
||||
<div className={`flex flex-row items-baseline text-gray-500`}>
|
||||
<span className={`text-gray-400`}>@{reaction.authorName}</span>
|
||||
<span>did</span>
|
||||
<span className={`text-lg`}>{reaction.emoji}</span>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue