You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

status-bar.tsx 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import { useStateDesigner } from '@state-designer/react'
  2. import state from 'state'
  3. import styled from 'styles'
  4. const size: any = { '@sm': 'small' }
  5. export default function StatusBar(): JSX.Element {
  6. const local = useStateDesigner(state)
  7. const active = local.active.slice(1).map((s) => {
  8. const states = s.split('.')
  9. return states[states.length - 1]
  10. })
  11. const log = local.log[0]
  12. return (
  13. <StatusBarContainer size={size}>
  14. <Section>
  15. {active.join(' | ')} | {log} | {local.data.room?.status}
  16. </Section>
  17. </StatusBarContainer>
  18. )
  19. }
  20. const StatusBarContainer = styled('div', {
  21. position: 'absolute',
  22. bottom: 0,
  23. left: 0,
  24. width: '100%',
  25. zIndex: 300,
  26. height: 40,
  27. userSelect: 'none',
  28. borderTop: '1px solid black',
  29. gridArea: 'status',
  30. display: 'grid',
  31. gridTemplateColumns: 'auto 1fr auto',
  32. alignItems: 'center',
  33. backgroundColor: 'white',
  34. gap: 8,
  35. fontSize: '$0',
  36. padding: '0 16px',
  37. variants: {
  38. size: {
  39. small: {
  40. fontSize: '$1',
  41. },
  42. },
  43. },
  44. })
  45. const Section = styled('div', {
  46. whiteSpace: 'nowrap',
  47. overflow: 'hidden',
  48. })