diff --git a/src/client/components/Dashboard/Dashboard.tsx b/src/client/components/Dashboard/Dashboard.tsx index 20469d6..6081d84 100644 --- a/src/client/components/Dashboard/Dashboard.tsx +++ b/src/client/components/Dashboard/Dashboard.tsx @@ -13,8 +13,34 @@ import { import { getLibraryStatistics } from "../../actions/comicinfo.actions"; import { isEmpty, isNil } from "lodash"; import Header from "../shared/Header"; +import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query"; +import axios from "axios"; +import { Card } from "../shared/Carda"; +import { + LIBRARY_SERVICE_BASE_URI, + LIBRARY_SERVICE_HOST, +} from "../../constants/endpoints"; export const Dashboard = (): ReactElement => { + const { data: recentComics } = useQuery({ + queryFn: async () => + await axios({ + url: `${LIBRARY_SERVICE_BASE_URI}/getComicBooks`, + method: "POST", + data: { + paginationOptions: { + page: 0, + limit: 5, + sort: { updatedAt: "-1" }, + }, + predicate: { "acquisition.source.wanted": false }, + comicStatus: "recent", + }, + }), + queryKey: ["recentComics"], + }); + + console.log("hari om", recentComics); // useEffect(() => { // dispatch(fetchVolumeGroups()); // dispatch( @@ -56,9 +82,19 @@ export const Dashboard = (): ReactElement => { // (state: RootState) => state.comicInfo.libraryStatistics, // ); return ( -
-
-

Dashboard

+
+
+

Dashboard

+
+ {recentComics?.data.docs.map((recentComic, idx) => ( + + ))} +
); diff --git a/src/client/components/shared/Carda.tsx b/src/client/components/shared/Carda.tsx index 67adc5b..ee16e46 100644 --- a/src/client/components/shared/Carda.tsx +++ b/src/client/components/shared/Carda.tsx @@ -4,8 +4,8 @@ import { isEmpty, isNil } from "lodash"; interface ICardProps { orientation: string; - imageUrl: string; - hasDetails: boolean; + imageUrl?: string; + hasDetails?: boolean; title?: PropTypes.ReactElementLike | null; children?: PropTypes.ReactNodeLike; borderColorClass?: string; @@ -80,6 +80,71 @@ const renderCard = (props: ICardProps): ReactElement => {
); + + case "vertical-2": + return ( +
+ Home + +
+
+
+
+ {props.title} +
+
+ +
+
Address
+
+ + Live + +
+
+
+ +
+
+ + + {/*
+

Parking

+

2 spaces

+
*/} +
+ +
+ + + + + {/*
+

Bathroom

+

2 rooms

+
*/} +
+ +
+
+
+
+ ); default: return <>; }