import { Container, Heading } from "@medusajs/ui" import { HttpTypes } from "@medusajs/types" import { PencilSquare } from "@medusajs/icons" import { useTranslation } from "react-i18next" import { ActionMenu } from "../../../../components/common/action-menu" import { SectionRow } from "../../../../components/common/section" type InventoryItemGeneralSectionProps = { inventoryItem: HttpTypes.AdminInventoryItemResponse["inventory_item"] } export const InventoryItemGeneralSection = ({ inventoryItem, }: InventoryItemGeneralSectionProps) => { const { t } = useTranslation() const getQuantityFormat = (quantity: number) => { if (quantity !== undefined && !isNaN(quantity)) { return t("inventory.quantityAcrossLocations", { quantity, locations: inventoryItem.location_levels?.length, }) } return "-" } return (
{inventoryItem.title ?? inventoryItem.sku} {t("fields.details")} , label: t("actions.edit"), to: "edit", }, ], }, ]} />
) }