32 lines
906 B
TypeScript
32 lines
906 B
TypeScript
import GridWrapper from "@/components/GridWrapper";
|
|
import { type FC } from "react";
|
|
import { useParams } from "react-router-dom";
|
|
import CatalogueGridSkeleton from "./components/CatalogueGridSkeleton";
|
|
import CatalogueItem from "./components/CatalogueItem";
|
|
import { useGetBusinessCatalog } from "./hooks/useCatalogueData";
|
|
|
|
const Business: FC = () => {
|
|
const { slug } = useParams<{ slug: string }>();
|
|
const { data, isPending, refetch } = useGetBusinessCatalog(slug ?? "");
|
|
|
|
if (isPending) {
|
|
return (
|
|
<div className="w-full mt-5">
|
|
<CatalogueGridSkeleton />
|
|
</div>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<div className="w-full mt-5">
|
|
<GridWrapper desktop={4} gapDesktop={40} mobile={1}>
|
|
{data?.data?.map((item) => {
|
|
return <CatalogueItem refetch={refetch} key={item.id} item={item} />;
|
|
})}
|
|
</GridWrapper>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default Business;
|