LiveTabScreen
Show what a browser tab draws once it is no longer the live POS tab, with a button to take over or reload.
Import
import { LiveTabScreen, type LiveTabScreenState } from '@tallyui/components';Usage
<LiveTabScreen state={liveTabState} onUseHere={takeOver} onReload={() => window.location.reload()} />The screen renders nothing for acquiring and live. For parked it shows the title, the parked body and a Use here button that calls onUseHere. For blocked it shows the same title, the blocked body and a Reload button that calls onReload. Other View props pass through to the outer view.
Props
LiveTabScreenProps extends the React Native ViewProps, without children.
| Prop | Type | Default | Description |
|---|---|---|---|
state | LiveTabScreenState | required | The tab's state |
onUseHere | () => void | required | Called when the parked screen's button is pressed |
onReload | () => void | required | Called when the blocked screen's button is pressed |
parkedTitle | string | 'POS is open in another tab' | Title for both the parked and the blocked screen |
parkedBody | string | 'This tab stopped so the other one can work. Use it here instead?' | Body of the parked screen |
useHereLabel | string | 'Use here' | Label of the parked screen's button |
blockedBody | string | 'The POS is open in another tab. Close that tab to use it here, or reload this one.' | Body of the blocked screen |
reloadLabel | string | 'Reload' | Label of the blocked screen's button |
className | string | — | Extra classes for the outer view |
LiveTabScreenState
type LiveTabScreenState = 'acquiring' | 'live' | 'parked' | 'blocked';It mirrors LiveTabState from @tallyui/database, without depending on that package.