index.tsx 563 B

1234567891011121314151617181920212223
  1. import React from 'react'
  2. import s from './style.module.css'
  3. type ISVGBtnProps = {
  4. isSVG: boolean
  5. setIsSVG: React.Dispatch<React.SetStateAction<boolean>>
  6. }
  7. const SVGBtn = ({
  8. isSVG,
  9. setIsSVG,
  10. }: ISVGBtnProps) => {
  11. return (
  12. <div
  13. className={'box-border p-0.5 flex items-center justify-center rounded-md bg-white cursor-pointer'}
  14. onClick={() => { setIsSVG(prevIsSVG => !prevIsSVG) }}
  15. >
  16. <div className={`w-6 h-6 rounded-md hover:bg-gray-50 ${s.svgIcon} ${isSVG ? s.svgIconed : ''}`}></div>
  17. </div>
  18. )
  19. }
  20. export default SVGBtn