import { FormattedMessage } from 'react-intl'; import classNames from 'classnames'; interface Props { hidden?: boolean; sensitive: boolean; uncached?: boolean; matchedFilters?: string[]; onClick: React.MouseEventHandler; } export const SpoilerButton: React.FC = ({ hidden = false, sensitive, uncached = false, matchedFilters, onClick, }) => { let warning; let action; if (uncached) { warning = ( ); action = ( ); } else if (matchedFilters) { warning = ( {chunks}, }} /> ); action = ( ); } else if (sensitive) { warning = ( ); action = ( ); } else { warning = ( ); action = ( ); } return (
); };