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.

27 lines
824 B

1 year ago
1 year ago
  1. import { useToken, cx, css } from '@/theme'
  2. import ActionIcon from '../action'
  3. import IconItem from './IconRender.tsx'
  4. import { usePickerContext } from './context.tsx'
  5. const Display = () => {
  6. const ctx = usePickerContext()
  7. const token = useToken()
  8. const DefaultIcon = (
  9. <div
  10. className={cx(css`
  11. width: 8px;
  12. height: 8px;
  13. border-radius: 50%;
  14. background: ${token.colorFillContent};
  15. `)}
  16. />
  17. )
  18. return ( <ActionIcon
  19. bordered={true}
  20. onClick={() => ctx.actions.togglePanel()}
  21. icon={!ctx.state.icon ? DefaultIcon : <IconItem {...ctx.state.icon as any} />} />
  22. )
  23. }
  24. export default Display