import Row from "@moduletrace/twui/layout/Row"; import Span from "@moduletrace/twui/layout/Span"; import Stack from "@moduletrace/twui/layout/Stack"; import type { TaskNote } from "@/src/types"; import relativeTime from "@/src/utils/relative-time"; type Props = { note: TaskNote; }; /** * One note on an opened task: who wrote it (the user, or the bot by name), * how long ago, and what it says. */ export default function TaskNoteRow({ note }: Props) { const author = note.author == "user" ? "You" : note.bot_name || "Bot"; return ( {author} {note.created_at ? ( {relativeTime({ at: Number(note.created_at) })} ) : null} {note.text} ); }