import * as React from 'react'; import I18n from 'i18n-js'; import Spinner from './Spinner'; import Box from './Box'; interface Props { areUpdating: boolean; error: string; areDirty?: boolean; isSticky?: boolean; saveButton?: React.ReactNode; } const SiteSettingsInfoBox = ({ areUpdating, error, areDirty = false, isSticky = false, saveButton = null, }: Props) => ( { areUpdating ? : error ? { I18n.t('site_settings.info_box.error', { message: JSON.stringify(error) }) } : areDirty ? <> { I18n.t('site_settings.info_box.dirty') } {saveButton && saveButton} : { I18n.t('site_settings.info_box.up_to_date') } } ); export default SiteSettingsInfoBox;