reorganize code into smaller files & dirs

This commit is contained in:
Martti Malmi
2024-01-04 15:48:19 +02:00
parent 5ea2eb711f
commit afa6d39a56
321 changed files with 671 additions and 671 deletions

View File

@ -0,0 +1,25 @@
import { OfflineError } from "@snort/shared";
import { Offline } from "./Offline";
import classNames from "classnames";
import Icon from "@/Components/Icons/Icon";
export function ErrorOrOffline({
error,
onRetry,
className,
}: {
error: Error;
onRetry?: () => void | Promise<void>;
className?: string;
}) {
if (error instanceof OfflineError) {
return <Offline onRetry={onRetry} className={className} />;
} else {
return (
<div className={classNames("flex flex-row items-center px-4 py-3 gap-2", className)}>
<Icon name="alert-circle" size={24} />
<b>{error.message}</b>
</div>
);
}
}