file-tree-action-button.tsx 732 B

123456789101112131415161718192021222324252627282930313233
  1. import OLTooltip from '@/shared/components/ol/ol-tooltip'
  2. import MaterialIcon, {
  3. AvailableUnfilledIcon,
  4. } from '@/shared/components/material-icon'
  5. import React from 'react'
  6. export default function FileTreeActionButton({
  7. id,
  8. description,
  9. onClick,
  10. iconType,
  11. }: {
  12. id: string
  13. description: string
  14. onClick: () => void
  15. iconType: AvailableUnfilledIcon
  16. }) {
  17. return (
  18. <OLTooltip
  19. id={id}
  20. description={description}
  21. overlayProps={{ placement: 'bottom' }}
  22. >
  23. <button className="btn file-tree-toolbar-action-button" onClick={onClick}>
  24. <MaterialIcon
  25. unfilled
  26. type={iconType}
  27. accessibilityLabel={description}
  28. />
  29. </button>
  30. </OLTooltip>
  31. )
  32. }