# Comment state

Whose turn a comment is: open, needs an agent, needs a person, or done, with who opened it and who holds it.

Live variants: https://design.arcadia.is/components/comment-state

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

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

<div {...stylex.props(CommentStateStyles.list)}>
  <CommentState state="open" opener={CommentStateMAYA} />
  <CommentState state="agent" opener={CommentStateMAYA} holder={CommentStateSCOUT} />
  <CommentState state="agent" opener={CommentStateMAYA} holder={CommentStateSCOUT} working />
  <CommentState state="person" opener={CommentStateSCOUT} holder={CommentStateSCOUT} waitsOn={LEILA} />
  <CommentState state="person" opener={CommentStateSCOUT} holder={CommentStateSCOUT} waitsOn={LEILA} you />
  <CommentState state="done" opener={CommentStateMAYA} holder={CommentStateSCOUT} done={{ by: CommentStateSCOUT, at: AT }} />
</div>
```

## Accessibility

The state is said in words, so neither the glyph nor the light carries it alone. The glyph is hidden from assistive technology. The waiting mark stands only for the person the comment waits on, and it keeps its own shape under forced colours. A working agent's loader is the neutral running glyph.

## API reference

### CommentState

- `opener` (`Actor`, required): Who opened it. An agent shows with the person it acts for.
- `brief` (`boolean`): The glyph and the words alone, where the row shows the opener itself.
- `rootStyle` (`RootStyle`): A component's typed override prop: `Layout` and its documented knobs, each the references it takes or another kit knob of its kind; anything else is a type error at the call site (STYLEX.md).
- `state` (`"open" | "agent" | "person" | "done"`, required): Nobody's turn: nobody holds it, or its holder has answered.
- `holder` (`Actor | CommentAgent`)
- `working` (`boolean`): The holder said it began.
- `waitsOn` (`{ name: string; picture?: string }`): A person: their name and their picture's address (without one, the initials of the name).
- `you` (`boolean`): That person is the reader: the words say "Needs you" and the waiting mark stands in the glyph's seat.
- `done` (`{ readonly by: Actor; /** Unix milliseconds. */ readonly at: number }`)

Rest props go to `<div>` props.
