2023-09-14 14:09:23 +08:00
|
|
|
import React from 'react'
|
|
|
|
import s from './style.module.css'
|
2025-03-03 14:44:51 +08:00
|
|
|
import ActionButton from '../action-button'
|
|
|
|
import cn from '@/utils/classnames'
|
2023-09-14 14:09:23 +08:00
|
|
|
|
|
|
|
type ISVGBtnProps = {
|
|
|
|
isSVG: boolean
|
|
|
|
setIsSVG: React.Dispatch<React.SetStateAction<boolean>>
|
|
|
|
}
|
|
|
|
|
|
|
|
const SVGBtn = ({
|
|
|
|
isSVG,
|
|
|
|
setIsSVG,
|
|
|
|
}: ISVGBtnProps) => {
|
|
|
|
return (
|
2025-03-03 14:44:51 +08:00
|
|
|
<ActionButton onClick={() => { setIsSVG(prevIsSVG => !prevIsSVG) }}>
|
2025-03-21 17:41:03 +08:00
|
|
|
<div className={cn('h-4 w-4', isSVG ? s.svgIconed : s.svgIcon)}></div>
|
2025-03-03 14:44:51 +08:00
|
|
|
</ActionButton>
|
2023-09-14 14:09:23 +08:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default SVGBtn
|