Skip to content

Commit

Permalink
change time output
Browse files Browse the repository at this point in the history
  • Loading branch information
firehawk89 committed Sep 24, 2023
1 parent 39c371a commit 9861adc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/message.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import getFormattedTime from '@/utils/getFormattedDate'
import Image from 'next/image'
import Link from 'next/link'

export default function Message({ timeCreated, children }) {
export default function Message({ sentAt, children }) {
const time = getFormattedTime(sentAt)

return (
<div className="flex items-end gap-2">
<Link className="rounded-full overflow-hidden" href="/">
Expand All @@ -15,7 +18,7 @@ export default function Message({ timeCreated, children }) {
</Link>
<div className="flex justify-between gap-2 rounded-lg rounded-bl-none w-fit max-w-md py-2 px-3 bg-orange-100">
<p className="break-words">{children}</p>
<span className="text-xs self-end">{timeCreated}</span>
<span className="text-xs self-end">{time}</span>
</div>
</div>
)
Expand Down

0 comments on commit 9861adc

Please sign in to comment.