Files
Flowise/packages/ui/src/ui-component/button/ThumbsDownButton.jsx
T
Octavian FlowiseAI cb0eb67df0 Use tabler icons react instead of tabler icons package (#2389)
* Use tabler icons react instead of tabler icons package

* Update package.json

---------

Co-authored-by: Octavian Cioaca <devtools@domselardi.com>
2024-05-10 21:17:12 +02:00

32 lines
973 B
React

import PropTypes from 'prop-types'
import { useSelector } from 'react-redux'
import { IconButton } from '@mui/material'
import { IconThumbDown } from '@tabler/icons-react'
const ThumbsDownButton = (props) => {
const customization = useSelector((state) => state.customization)
return (
<IconButton
disabled={props.isDisabled || props.isLoading}
onClick={props.onClick}
size='small'
sx={{ background: 'transparent', border: 'none' }}
title='Thumbs Down'
>
<IconThumbDown
style={{ width: '20px', height: '20px' }}
color={props.rating === 'THUMBS_DOWN' ? '#9e9e9e' : customization.isDarkMode ? 'white' : '#1e88e5'}
/>
</IconButton>
)
}
ThumbsDownButton.propTypes = {
isDisabled: PropTypes.bool,
isLoading: PropTypes.bool,
onClick: PropTypes.func,
rating: PropTypes.string
}
export default ThumbsDownButton