LockStatus
Shows a badge naming the record's lock holder and updates when the lock is taken or released. Renders nothing for a free record unless renderFree is supplied. Needs a realtime data provider with lock support.
Installation
pnpm dlx shadcn@latest add @chelone/lock-statusLoading preview…
Shows a badge naming the record's lock holder and updates when the lock is taken or released. Renders nothing for a free record unless renderFree is supplied. Needs a realtime data provider with lock support.
See the realtime guide for provider setup and usage.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| id | Identifier | — | Defaults to the id of the record context. |
| renderFree | () => ReactNode | — | Rendered when the record is free. Defaults to nothing. |
| renderLock | (lock: Lock) => ReactNode | — | Replaces the default badge naming the holder. |
| resource | string | — | Defaults to the resource context. |