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

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