import { useState } from "react"; import { Badge, Button, LayerCard } from "@cloudflare/kumo"; import { ArrowLineUp, CaretRight, Check, GitBranch, Warning, XCircle } from "@phosphor-icons/react"; import type { Brand, ProjectState } from "./contracts.ts"; import { copyText, ownerNeeds, type CopyPart, type OwnerNeed } from "./needs-you-model.ts"; const icons = { promotionPending: Warning, reconciler: GitBranch, blocker: Warning, failed: XCircle, promote: ArrowLineUp, approve: Check, }; function Copy({ parts }: { parts: CopyPart[] }) { return parts.map((part, index) => typeof part === "string" ? ( part ) : ( {part.code} ), ); } export function NeedsYou({ state, brand, open, }: { state: ProjectState; brand: Brand; open(target: OwnerNeed["target"]): void; }) { const [expanded, setExpanded] = useState(false); const items = ownerNeeds(state, brand); return (

Needs you

{items.length > 0 && {items.length}}
{items.length ? ( <> {!expanded && items.length > 5 && ( )} ) : (

)}
); }