/**
* WordPress dependencies
*/
import { useState } from '@wordpress/element';
import { __experimentalText as Text } from '@wordpress/components';
import { Stack } from '@wordpress/ui';
/**
* Internal dependencies
*/
import DataViews from '../index';
import {
LAYOUT_GRID,
LAYOUT_LIST,
LAYOUT_TABLE,
LAYOUT_ACTIVITY,
} from '../../constants';
import type { View } from '../../types';
import { actions, fields } from './fixtures';
const PlanetIllustration = () => (
);
const CustomEmptyComponent = () => (
No celestial bodies found
);
const EmptyComponent = ( {
customEmpty,
isLoading,
}: {
customEmpty?: boolean;
isLoading?: boolean;
} ) => {
const [ view, setView ] = useState< View >( {
type: LAYOUT_TABLE,
search: '',
page: 1,
perPage: 10,
layout: {},
filters: [],
fields: [ 'title', 'description', 'categories' ],
} );
return (
item.id.toString() }
paginationInfo={ { totalItems: 0, totalPages: 0 } }
data={ [] }
view={ view }
fields={ fields }
onChangeView={ setView }
actions={ actions }
defaultLayouts={ {
[ LAYOUT_TABLE ]: {},
[ LAYOUT_GRID ]: {},
[ LAYOUT_LIST ]: {},
[ LAYOUT_ACTIVITY ]: {},
} }
isLoading={ isLoading }
empty={ customEmpty ? : undefined }
/>
);
};
export default EmptyComponent;