mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2026-05-03 21:05:00 -04:00
* init * changes * Now updating statistics once a minute * More robust statistics updater * Concurrency is hard * improvements to stats * refactor * adjust setting back/forward padding so it matches top bar * refactor sidebar * rename * setting up screens * some changes * Co-authored-by: Brendan Allan <Brendonovich@users.noreply.github.com> * yes * yes2 * refactored explorerItem.ts * important explorer code shouldn't be thrown away in a util moment * support for multiple thumbnails in ExplorerItem * clippy * move debug * yes * label filters * ts * comment out unconnected stuff * added .mid for midi files --------- Co-authored-by: Ericson Fogo Soares <ericson.ds999@gmail.com> Co-authored-by: Brendan Allan <brendonovich@outlook.com>
42 lines
976 B
TypeScript
42 lines
976 B
TypeScript
import { Columns, GridFour, Icon, MonitorPlay, Rows } from '@phosphor-icons/react';
|
|
import { isValidElement, ReactNode } from 'react';
|
|
|
|
import { useExplorerContext } from '../Context';
|
|
|
|
export const EmptyNotice = (props: {
|
|
icon?: Icon | ReactNode;
|
|
message?: ReactNode;
|
|
loading?: boolean;
|
|
}) => {
|
|
const { layoutMode } = useExplorerContext().useSettingsSnapshot();
|
|
|
|
const emptyNoticeIcon = (icon?: Icon) => {
|
|
const Icon =
|
|
icon ??
|
|
{
|
|
grid: GridFour,
|
|
media: MonitorPlay,
|
|
columns: Columns,
|
|
list: Rows
|
|
}[layoutMode];
|
|
|
|
return <Icon size={100} opacity={0.3} />;
|
|
};
|
|
|
|
if (props.loading) return null;
|
|
|
|
return (
|
|
<div className="flex h-full flex-col items-center justify-center text-ink-faint">
|
|
{props.icon
|
|
? isValidElement(props.icon)
|
|
? props.icon
|
|
: emptyNoticeIcon(props.icon as Icon)
|
|
: emptyNoticeIcon()}
|
|
|
|
<p className="mt-5">
|
|
{props.message !== undefined ? props.message : 'This list is empty'}
|
|
</p>
|
|
</div>
|
|
);
|
|
};
|