import React from 'react'; import { defineMessages, useIntl } from 'react-intl'; import useSWR from 'swr'; import Alert from '../Common/Alert'; const messages = defineMessages({ dockerVolumeMissingDescription: 'The {appDataPath} volume mount was not configured properly. All data will be cleared when the container is stopped or restarted.', }); const AppDataWarning: React.FC = () => { const intl = useIntl(); const { data, error } = useSWR<{ appData: boolean; appDataPath: string }>( '/api/v1/status/appdata' ); if (!data && !error) { return null; } if (!data) { return null; } return ( <> {!data.appData && ( {msg}; }, appDataPath: data.appDataPath, })} /> )} ); }; export default AppDataWarning;