import type { FC } from 'react'; import type { IntlShape } from 'react-intl'; import { defineMessages } from 'react-intl'; import { Icon } from '@/mastodon/components/icon'; import DisabledIcon from '@/material-icons/400-24px/close-fill.svg?react'; import EnabledIcon from '@/material-icons/400-24px/done-fill.svg?react'; const messages = defineMessages({ enabled: { id: 'about.enabled', defaultMessage: 'Enabled' }, disabled: { id: 'about.disabled', defaultMessage: 'Disabled' }, }); interface CapabilityIconProps { intl: IntlShape; state: boolean; } export const CapabilityIcon: FC = ({ intl, state }) => { if (state) { return ( {intl.formatMessage(messages.enabled)} ); } else { return ( {intl.formatMessage(messages.disabled)} ); } };