/**
* Accepted comment threads, in the prose.
*
* Accepted threads are durable plan content, rendered from their frozen record.
* Collapsed they are one line like a settled decision; the thread opens on demand.
*/
import { useId, useState } from "react";
import { ChevronIcon, MessageIcon } from "@chopin/icons";
import { when } from "../card";
import type { Decision, DecisionNode } from "@chopin/dialect";
export function DecisionCard({ value }: { value: Decision }) {
let [open, setOpen] = useState(false);
let bodyId = useId();
let stamp = value.at === undefined ? "" : when(value.at);
return (
{open && (
{value.quote}
{value.notes.map((note, index) => (
@{note.by}
{note.text}
))}
{value.by && <>Accepted by @{value.by}>}
{stamp && ` · ${stamp}`}