| 1 |
const FontStyleButtons = ({ |
| 2 |
isBold = false, |
| 3 |
isItalic = false, |
| 4 |
isUnderline = false, |
| 5 |
onBoldToggle, |
| 6 |
onItalicToggle, |
| 7 |
onUnderlineToggle, |
| 8 |
disabled = false, |
| 9 |
}) => { |
| 10 |
return ( |
| 11 |
<div |
| 12 |
className={`disco-flex disco-bg-gray-50 disco-rounded disco-items-center disco-gap-1 disco-p-1 ${disabled ? 'disco-opacity-50' : ''}`} |
| 13 |
> |
| 14 |
<button |
| 15 |
type="button" |
| 16 |
onClick={onBoldToggle} |
| 17 |
disabled={disabled} |
| 18 |
className={`disco-px-2 disco-py-1 disco-rounded disco-font-bold disco-text-sm ${ |
| 19 |
isBold |
| 20 |
? 'disco-bg-primary disco-text-white' |
| 21 |
: 'disco-bg-white disco-text-gray-700 hover:disco-bg-gray-100' |
| 22 |
} ${disabled ? 'disco-cursor-not-allowed' : ''}`} |
| 23 |
> |
| 24 |
B |
| 25 |
</button> |
| 26 |
<button |
| 27 |
type="button" |
| 28 |
onClick={onItalicToggle} |
| 29 |
disabled={disabled} |
| 30 |
className={`disco-px-2 disco-py-1 disco-rounded disco-italic disco-text-sm ${ |
| 31 |
isItalic |
| 32 |
? 'disco-bg-primary disco-text-white' |
| 33 |
: 'disco-bg-white disco-text-gray-700 hover:disco-bg-gray-100' |
| 34 |
} ${disabled ? 'disco-cursor-not-allowed' : ''}`} |
| 35 |
> |
| 36 |
I |
| 37 |
</button> |
| 38 |
<button |
| 39 |
type="button" |
| 40 |
onClick={onUnderlineToggle} |
| 41 |
disabled={disabled} |
| 42 |
className={`disco-px-2 disco-py-1 disco-rounded disco-underline disco-text-sm ${ |
| 43 |
isUnderline |
| 44 |
? 'disco-bg-primary disco-text-white' |
| 45 |
: 'disco-bg-white disco-text-gray-700 hover:disco-bg-gray-100' |
| 46 |
} ${disabled ? 'disco-cursor-not-allowed' : ''}`} |
| 47 |
> |
| 48 |
U |
| 49 |
</button> |
| 50 |
</div> |
| 51 |
); |
| 52 |
}; |
| 53 |
|
| 54 |
export default FontStyleButtons; |
| 55 |
|