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