dify/web/app/components/base/svg/index.tsx
Stephen Zhou a26881cb24
refactor: unified cn utils (#29916)
Co-authored-by: yyh <yuanyouhuilyz@gmail.com>
Co-authored-by: yyh <92089059+lyzno1@users.noreply.github.com>
2025-12-19 12:08:34 +08:00

23 lines
517 B
TypeScript

import React from 'react'
import s from './style.module.css'
import ActionButton from '../action-button'
import { cn } from '@/utils/classnames'
type ISVGBtnProps = {
isSVG: boolean
setIsSVG: React.Dispatch<React.SetStateAction<boolean>>
}
const SVGBtn = ({
isSVG,
setIsSVG,
}: ISVGBtnProps) => {
return (
<ActionButton onClick={() => { setIsSVG(prevIsSVG => !prevIsSVG) }}>
<div className={cn('h-4 w-4', isSVG ? s.svgIconed : s.svgIcon)}></div>
</ActionButton>
)
}
export default SVGBtn