added the pageload api

This commit was merged in pull request #546.
This commit is contained in:
2024-01-10 17:41:52 +01:00
parent 9dde87277c
commit 57be599bb5
5 changed files with 91 additions and 1 deletions
+32
View File
@@ -0,0 +1,32 @@
import React from "react";
import GetMyPageLoad from "./getMyPageLoad";
const LoadedPage = () => {
const { loading, data, error } = GetMyPageLoad();
return (
<div className="w-full border border-gray-400 rounded-md p-4 flex flex-col h-72 gap-2 overflow-y-auto">
{loading ? (
<>
<h1 className="text-xl font-bold tracking-wide">...</h1>
<p>...</p>
</>
) : error ? (
<>
<h1 className="text-xl font-bold tracking-wide">Unable to load</h1>
</>
) : (
<>
<h1 className="text-xl font-bold tracking-wide">
{!data.intro ? "Introduction" : data.intro}
</h1>
<p>{!data.description ? "Brief Details" : data.description}</p>
</>
)}
</div>
);
};
export default LoadedPage;