import { ProvenanceGraph } from "@provenancekit/ui";
// Auto-fetch from CID
<ProvenanceGraph cid="bafybei..." depth={5} height={500} />
// Headless mode — "The Illustrated Article" editorial workflow
<ProvenanceGraph
nodes={[
// Entities
{ id: "entity:sarah", type: "entity", label: "Sarah Kim", data: { role: "human" } },
{ id: "entity:digest", type: "entity", label: "Illustrated Digest", data: { role: "organization" } },
// Resources
{ id: "resource:draft", type: "resource", label: "article-draft.md", data: { type: "text/markdown" } },
{ id: "resource:image", type: "resource", label: "header-image.png", data: { type: "image/png" } },
{ id: "resource:final", type: "resource", label: "illustrated-guide-final.md", data: { type: "text/markdown" } },
// Actions — AI actions show a tool badge automatically
{ id: "action:write", type: "action", label: "Write Draft", data: { type: "create", timestamp: "2026-03-07T09:15:00Z" } },
{ id: "action:image", type: "action", label: "Generate Image", data: { type: "create", timestamp: "2026-03-07T10:02:00Z", "ext:ai@1.0.0": { provider: "black-forest-labs", model: "flux-schnell" } } },
{ id: "action:polish", type: "action", label: "Polish Article", data: { type: "transform", timestamp: "2026-03-07T10:18:00Z", "ext:ai@1.0.0": { provider: "anthropic", model: "claude-opus-4-6" } } },
{ id: "action:publish", type: "action", label: "Editorial Review",data: { type: "verify", timestamp: "2026-03-07T11:45:00Z" } },
]}
edges={[
{ from: "entity:sarah", to: "action:write", type: "performedBy" },
{ from: "action:write", to: "resource:draft", type: "produces" },
{ from: "resource:draft",to: "action:image", type: "consumes" },
{ from: "entity:digest", to: "action:image", type: "performedBy" },
{ from: "action:image", to: "resource:image", type: "produces" },
{ from: "resource:draft",to: "action:polish", type: "consumes" },
{ from: "entity:digest", to: "action:polish", type: "performedBy" },
{ from: "resource:image",to: "action:publish", type: "consumes" },
{ from: "entity:digest", to: "action:publish", type: "performedBy" },
{ from: "action:publish",to: "resource:final", type: "produces" },
]}
height={500}
onNodeClick={(node) => console.log("Clicked:", node.id)}
/>