feat: add profile route and sidebar navigation; implement inventory and view product pages
- Added a new profile route under the hidden layout. - Introduced a Sidebar component for navigation between inventory, add product, and profile pages. - Created InventoryPage to display a list of products with sorting and pagination. - Implemented ViewProduct page to show details of a selected product. - Integrated API calls for fetching products and product details. - Updated route tree to include new routes and components.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { getProductDetails } from "../utils/uxFncs";
|
||||
import { CircularProgress, Typography } from "@mui/joy";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
interface ViewProductProps {
|
||||
uuid: string;
|
||||
}
|
||||
|
||||
export const ViewProduct = (props: ViewProductProps) => {
|
||||
const uuid = props.uuid;
|
||||
const { t } = useTranslation();
|
||||
|
||||
const { data: productDetails, isLoading: productDetailsLoading } = useQuery({
|
||||
queryKey: ["product", uuid],
|
||||
queryFn: () => getProductDetails(uuid),
|
||||
});
|
||||
|
||||
return (
|
||||
<>
|
||||
<Typography>{t("product-details")}</Typography>
|
||||
{productDetailsLoading && <CircularProgress size="sm" />}
|
||||
</>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user