import React from 'react'; import { defineMessages, useIntl } from 'react-intl'; import { changeComposeSpoilerness } from 'soapbox/actions/compose'; import { useAppDispatch, useAppSelector } from 'soapbox/hooks'; import ComposeFormButton from './compose_form_button'; const messages = defineMessages({ marked: { id: 'compose_form.spoiler.marked', defaultMessage: 'Text is hidden behind warning' }, unmarked: { id: 'compose_form.spoiler.unmarked', defaultMessage: 'Text is not hidden' }, }); interface ISpoilerButton { composeId: string, } const SpoilerButton: React.FC = ({ composeId }) => { const intl = useIntl(); const dispatch = useAppDispatch(); const active = useAppSelector((state) => state.compose.get(composeId)!.spoiler); const onClick = () => dispatch(changeComposeSpoilerness(composeId)); return ( ); }; export default SpoilerButton;