# Result card

A connector's or a tool's result in the conversation: the operation, its target, its state, the tables it touched, what it printed and what changed, all from plain data.

Live variants: https://design.arcadia.is/components/result-card

```tsx
import { ResultCard } from "@arcadia/ui";
```

```tsx
import { ResultCard } from "@arcadia/ui";

<div {...sx("cmp-result-card-column", ResultCardS.column)}>
  <ResultCard
    from={{ name: "Supabase", picture: PICTURE }}
    title="Schema"
    detail="2 tables"
    status={{ state: "done", label: "Applied" }}
    tables={RESULT_TABLES}
    changes={[{ count: 1_284, label: "users moved" }]}
    link={LINK}
  />
</div>
```

## Accessibility

The tabs are the kit's own: a tablist, one stop in the strip, arrow keys to move and Enter or Space to open a table, whose panel is a Tab stop named by its tab. Each tab's name says its table and its state. A step says its state word to a reader, and a change says it too when it is not done. The status is a polite region: an operation that starts or finishes is said once, while a counting time is not repeated every second. Every mark is drawing, and every cut text keeps its full words in a tooltip and as its accessible name.

The output is a group named Output. Its command stands after a prompt that is drawing, so a reader hears the command alone. Arguments are a plain block with one copy of their own. A cut output has one button, its count in its name, that opens the text it names; the copy says Copied politely once it lands. The card's action is a button named by its words, and while busy it says aria-busy and refuses a second press.

- Tab: Moves into the card: its tabs, then its table's panel, then its output's controls, then its link, then its action button when it has one
- Left: Moves along the tabs, with Right, Home and End
- Enter: Opens the table under the tab, follows the link, and opens or closes the output

## API reference

### ResultCard

- `nesting` (`"contained-object"`): A separately framed object that belongs inside another one, not a layout wrapper.
- `from` (`{ name: string; picture?: ReactNode }`, required)
- `title` (`string`, required)
- `tool` (`string`)
- `detail` (`string`)
- `status` (`ResultStatus`)
- `steps` (`readonly ResultStep[]`)
- `tables` (`readonly ResultTable[]`)
- `changes` (`readonly ResultChange[]`)
- `output` (`ResultOutput`)
- `link` (`{ label: string; href: string }`)
- `action` (`{ label: string; onAction: () => void; busy?: boolean }`)
- `rootStyle` (`ResultCardStyle`)
