mirror of
https://github.com/karl0ss/homepage.git
synced 2025-04-29 12:03:41 +01:00
improve error state for resources component
This commit is contained in:
parent
481cb71e65
commit
ca7ccee3d0
@ -1,6 +1,7 @@
|
|||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
import { FiHardDrive, FiCpu } from "react-icons/fi";
|
import { FiHardDrive, FiCpu } from "react-icons/fi";
|
||||||
import { FaMemory } from "react-icons/fa";
|
import { FaMemory } from "react-icons/fa";
|
||||||
|
import { BiError } from "react-icons/bi";
|
||||||
|
|
||||||
export default function Resources({ options }) {
|
export default function Resources({ options }) {
|
||||||
const { data, error } = useSWR(
|
const { data, error } = useSWR(
|
||||||
@ -11,7 +12,15 @@ export default function Resources({ options }) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
return <div>failed to load</div>;
|
return (
|
||||||
|
<div className="flex-none flex flex-row items-center justify-center mr-5">
|
||||||
|
<BiError className="text-theme-800 dark:text-theme-200 w-5 h-5" />
|
||||||
|
<div className="flex flex-col ml-3 text-left font-mono">
|
||||||
|
<span className="text-theme-800 dark:text-theme-200 text-xs">Resources</span>
|
||||||
|
<span className="text-theme-800 dark:text-theme-200 text-xs">Error</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user