import React, { FunctionComponent, useContext } from 'react'; import { useTranslation } from 'react-i18next'; import { Button, Typography } from '@material-ui/core'; import { InboxItemEditContext } from '../InboxPanel'; export const TabContent: FunctionComponent<{ header: string; buttonLabel: string; onSubmit: () => void; selectedCerts: number[]; disableButton?: boolean; }> = (props): JSX.Element => { const { t } = useTranslation(); const { selectedCerts, disableButton } = props; const { isEditing } = useContext(InboxItemEditContext); const submitButtonDisabled = isEditing || selectedCerts.length === 0 || selectedCerts.length > 1 || disableButton; return (
{t(props.header)} {props.children}
); };