diff --git a/packages/admin-next/dashboard/src/i18n/translations/en.json b/packages/admin-next/dashboard/src/i18n/translations/en.json index 9ee6da9fed..f875fec67c 100644 --- a/packages/admin-next/dashboard/src/i18n/translations/en.json +++ b/packages/admin-next/dashboard/src/i18n/translations/en.json @@ -217,7 +217,11 @@ "galleryLabel": "Gallery", "downloadImageLabel": "Download current image", "deleteImageLabel": "Delete current image", - "noMediaLabel": "The product has no associated media." + "emptyState": { + "header": "No media yet", + "description": "Add media to the product to showcase it in your storefront.", + "action": "Add media" + } }, "discountableHint": "When unchecked discounts will not be applied to this product.", "noSalesChannels": "Not available in any sales channels", diff --git a/packages/admin-next/dashboard/src/routes/products/product-detail/components/product-media-section/product-media-section.tsx b/packages/admin-next/dashboard/src/routes/products/product-detail/components/product-media-section/product-media-section.tsx index efb31d39cd..186e1bc62c 100644 --- a/packages/admin-next/dashboard/src/routes/products/product-detail/components/product-media-section/product-media-section.tsx +++ b/packages/admin-next/dashboard/src/routes/products/product-detail/components/product-media-section/product-media-section.tsx @@ -1,10 +1,12 @@ import { PencilSquare, ThumbnailBadge } from "@medusajs/icons" import { Product } from "@medusajs/medusa" import { + Button, Checkbox, CommandBar, Container, Heading, + Text, Tooltip, clx, usePrompt, @@ -97,7 +99,7 @@ export const ProductMediaSection = ({ product }: ProductMedisaSectionProps) => { ]} /> - {media && ( + {media.length > 0 ? (
{media.map((i, index) => { const isSelected = selection[i.id] @@ -138,6 +140,27 @@ export const ProductMediaSection = ({ product }: ProductMedisaSectionProps) => { ) })}
+ ) : ( +
+
+ + {t("products.media.emptyState.header")} + + + {t("products.media.emptyState.description")} + +
+ +
)} diff --git a/packages/admin-next/dashboard/src/routes/products/product-media/components/product-media-gallery/product-media-gallery.tsx b/packages/admin-next/dashboard/src/routes/products/product-media/components/product-media-gallery/product-media-gallery.tsx index 41e2d0ad9e..eafdb2ade6 100644 --- a/packages/admin-next/dashboard/src/routes/products/product-media/components/product-media-gallery/product-media-gallery.tsx +++ b/packages/admin-next/dashboard/src/routes/products/product-media/components/product-media-gallery/product-media-gallery.tsx @@ -1,6 +1,5 @@ import { ArrowDownTray, - ExclamationCircle, ThumbnailBadge, Trash, TriangleLeftMini, @@ -172,9 +171,23 @@ const Canvas = ({ media, curr }: { media: Media[]; curr: number }) => { if (media.length === 0) { return ( -
- - {t("products.media.noMediaLabel")} +
+
+ + {t("products.media.emptyState.header")} + + + {t("products.media.emptyState.description")} + +
+
) }