import { MessageForwardIcon } from "@chopin/icons"; import { InlineCode } from "@chopin/question/react"; import { Face } from "@chopin/editor"; import type { SourceDestination } from "./card-parts"; import type { EvidenceRow } from "./evidence"; function People({ handles, label, opposed = false }: { handles: string[]; label: string; opposed?: boolean; }) { if (handles.length === 0) return null; let shown = handles.slice(0, 8); return ( {label} {handles.join(", ")} {shown.map((handle, index) => ( 0 ? "-ml-1" : ""} ${ opposed ? "ring-2 ring-destructive" : "" }`} key={handle} > ))} {handles.length > 8 && ( +{handles.length - 8} )} ); } export function EvidencePopover({ rows, onSource }: { rows: EvidenceRow[]; onSource: (destination: SourceDestination) => void; }) { return ( {rows.map(row => ( {row.origin === "planner" && ( Planner suggested )} {row.origin === "planner" && row.rationale && ( Why Chopin suggested this: {row.rationale} )} {row.origin === "planner" && row.source && row.optionId && ( {row.source.author.kind === "member" ? `@${row.source.author.handle}` : "Planner"} {row.source.quote} onSource({ source: row.source!, itemId: row.optionId! })} type="button" > )} {row.items.length > 0 && ( {row.items.map(item => { let source = item.sources[0]; return ( {item.kind === "reason" ? "Reason" : "Constraint"} {item.text} {source && ( onSource({ source, itemId: item.id })} type="button" > )} ); })} )} ))} ); }
Why Chopin suggested this: {row.rationale}
{row.source.quote}