This commit is contained in:
@@ -21,7 +21,7 @@ const Business: FC = () => {
|
|||||||
<div className="w-full mt-5">
|
<div className="w-full mt-5">
|
||||||
<GridWrapper desktop={4} gapDesktop={40} mobile={1}>
|
<GridWrapper desktop={4} gapDesktop={40} mobile={1}>
|
||||||
{data?.data?.map((item) => {
|
{data?.data?.map((item) => {
|
||||||
return <CatalogueItem slug={slug ?? ""} refetch={refetch} key={item.id} item={item} />;
|
return <CatalogueItem slug={slug ?? ""} refetch={refetch} key={item.id} item={item} readOnly />;
|
||||||
})}
|
})}
|
||||||
</GridWrapper>
|
</GridWrapper>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -16,9 +16,10 @@ type Props = {
|
|||||||
item: CatalogItemType;
|
item: CatalogItemType;
|
||||||
refetch: () => void;
|
refetch: () => void;
|
||||||
slug?: string;
|
slug?: string;
|
||||||
|
readOnly?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
const CatalogueItem: FC<Props> = ({ item, refetch, slug }) => {
|
const CatalogueItem: FC<Props> = ({ item, refetch, slug, readOnly }) => {
|
||||||
const { data: business } = useGetBusiness();
|
const { data: business } = useGetBusiness();
|
||||||
const deleteCatalog = useDleteCatalog();
|
const deleteCatalog = useDleteCatalog();
|
||||||
|
|
||||||
@@ -70,17 +71,21 @@ const CatalogueItem: FC<Props> = ({ item, refetch, slug }) => {
|
|||||||
<Eye size={18} color="#0047FF" />
|
<Eye size={18} color="#0047FF" />
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
<Link to={Paths.editor + `/${item.id}`}>
|
{!readOnly && (
|
||||||
<div className="size-6 bg-[#EAECF4] rounded-md flex justify-center items-center">
|
<Link to={Paths.editor + `/${item.id}`}>
|
||||||
<Edit size={18} color="#0047FF" />
|
<div className="size-6 bg-[#EAECF4] rounded-md flex justify-center items-center">
|
||||||
</div>
|
<Edit size={18} color="#0047FF" />
|
||||||
</Link>
|
</div>
|
||||||
|
</Link>
|
||||||
|
)}
|
||||||
<button type="button" onClick={handleShare} className="size-6 bg-[#EAECF4] rounded-md flex justify-center items-center border-0 p-0 cursor-pointer shrink-0" aria-label="اشتراکگذاری">
|
<button type="button" onClick={handleShare} className="size-6 bg-[#EAECF4] rounded-md flex justify-center items-center border-0 p-0 cursor-pointer shrink-0" aria-label="اشتراکگذاری">
|
||||||
<Share size={18} color="#000" />
|
<Share size={18} color="#000" />
|
||||||
</button>
|
</button>
|
||||||
<div className="size-6 bg-[#EAECF4] rounded-md flex justify-center items-center">
|
{!readOnly && (
|
||||||
<TrashWithConfrim onDelete={handleDelete} colorIcon="red" isloading={deleteCatalog.isPending} />
|
<div className="size-6 bg-[#EAECF4] rounded-md flex justify-center items-center">
|
||||||
</div>
|
<TrashWithConfrim onDelete={handleDelete} colorIcon="red" isloading={deleteCatalog.isPending} />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user