import { SimpleList as RaSimpleList, SimpleListProps, useTranslate } from 'react-admin';
import { Empty } from '@/components/ra-lists/Empty';
import { Typography } from '@mui/material';

function SimpleList({ empty, ...props }: SimpleListProps): JSX.Element {
  const translate = useTranslate();
  const DefaultEmpty = (
    <Empty
      sx={{ '& .ApplicaEmpty-icon': { fontSize: '7em' } }}
      title={
        <Typography variant="subtitle1" style={{ color: 'inherit' }} gutterBottom>
          {translate('ra.navigation.no_results')}
        </Typography>
      }
    />
  );

  return <RaSimpleList {...props} empty={empty || DefaultEmpty} />;
}

export { SimpleList };
