Add retry logic to Library error handling

This commit is contained in:
schroda
2024-04-27 22:29:23 +02:00
parent 773d2b1026
commit 7531edbd59
4 changed files with 51 additions and 63 deletions

View File

@@ -27,9 +27,10 @@ interface IProps {
message: string;
messageExtra?: JSX.Element | string;
retry?: () => void;
noFaces?: boolean;
}
export function EmptyView({ message, messageExtra, retry }: IProps) {
export function EmptyView({ message, messageExtra, retry, noFaces }: IProps) {
const { t } = useTranslation();
const theme = useTheme();
const isMobileWidth = useMediaQuery(theme.breakpoints.down('sm'));
@@ -47,9 +48,11 @@ export function EmptyView({ message, messageExtra, retry }: IProps) {
alignItems: 'center',
}}
>
<Typography variant="h3" gutterBottom>
{errorFace}
</Typography>
{!noFaces && (
<Typography variant="h3" gutterBottom>
{errorFace}
</Typography>
)}
{retry && <Button onClick={retry}>{t('global.button.retry')}</Button>}
<Typography variant="h5">{message}</Typography>
{messageExtra}