// SPDX-License-Identifier: MIT
// Copyright (c) 2024-2026 Acme Corp.
import { useState } from "react";
import { Comment } from "./components/Comment";
import { formatRelative } from "./utils/format";

export function App() {
    const [comments, setComments] = useState<{ id: string; body: string; at: number }[]>([]);
    return (
        <main>
            <header><h1>Acme Demo</h1></header>
            <section>
                {comments.map(c => <Comment key={c.id} body={c.body} stamp={formatRelative(c.at)} />)}
            </section>
        </main>
    );
}
