feat: cards, attributes and modules

This commit is contained in:
2025-02-19 14:46:13 +04:00
parent cc3e72bf94
commit dc9455966e
286 changed files with 2355 additions and 2168 deletions

View File

@@ -0,0 +1 @@
export { CardPage } from "./ui/CardPage.tsx";

View File

@@ -0,0 +1,38 @@
import { useParams } from "@tanstack/react-router";
import { CardPageContextProvider, useCardPageContext } from "../../CardsPage/contexts/CardPageContext.tsx";
import ProductAndServiceTab from "../../CardsPage/tabs/ProductAndServiceTab/ProductAndServiceTab.tsx";
import React, { FC, useEffect } from "react";
import { CardService } from "../../../client";
export type Props = {
cardId: number;
};
const CardPageContent: FC<Props> = ({ cardId }) => {
const { setSelectedCard } = useCardPageContext();
useEffect(() => {
CardService.getCardById({ cardId }).then(card => {
setSelectedCard(card);
});
}, []);
return <ProductAndServiceTab />;
};
const CardPageWrapper: FC<{ children: React.ReactNode }> = ({ children }) => {
return (
<CardPageContextProvider
refetchCards={async () => {
}}
>
{children}
</CardPageContextProvider>
);
};
export const CardPage = () => {
const { dealId } = useParams({ strict: false });
return (
<CardPageWrapper>
<CardPageContent cardId={parseInt(dealId || "-1")} />
</CardPageWrapper>
);
};