\r\n {items.map((item, index) => {\r\n return (\r\n
\r\n \r\n {index < length - 1 && }\r\n \r\n )\r\n })}\r\n
\r\n )\r\n}\r\n","import { useMemo } from \"react\"\r\nimport { AvailabilityStatus, ErpInformation, ErpSystemConfig, SuccessArticleErpInfo } from \"@tm/models\"\r\nimport { useLocalization } from \"@tm/localization\"\r\nimport { Stack, styled } from \"@mui/material\"\r\nimport { useDefaultArticleItemState } from \"../ContextProviderStates/DefaultArticleItemState\"\r\nimport { useArticleItemState } from \"../ContextProviderStates\"\r\n\r\nconst DEFAULTGAP = 0.5\r\n\r\ntype AvailabilitiesProps = {\r\n defaultArticleErpInfo?: SuccessArticleErpInfo\r\n alternativeArticleErpInfo?: SuccessArticleErpInfo\r\n isCompact?: boolean\r\n}\r\n\r\nexport function Availabilities({ defaultArticleErpInfo, alternativeArticleErpInfo, isCompact }: AvailabilitiesProps) {\r\n const { translateText } = useLocalization()\r\n const AvailabilityComponent = useArticleItemState((x) => x.AvailabilityComponent)\r\n const handleClickAvailability = useDefaultArticleItemState((x) => x.handleClickAvailability)\r\n\r\n const Availability = useMemo(() => styled(AvailabilityComponent)({ \"> div\": { display: \"block\" } }), [AvailabilityComponent])\r\n const info = useDefaultArticleItemState((x) => x.extendedDeliveryInfo?.info)\r\n\r\n const erpInfos = useMemo(() => {\r\n const list: {\r\n availability: ErpInformation[\"availability\"]\r\n requestedQuantity?: number\r\n warehouses?: ErpInformation[\"warehouses\"]\r\n tour?: ErpInformation[\"tour\"]\r\n erpSystem?: ErpSystemConfig\r\n itemId?: string\r\n }[] = []\r\n if (defaultArticleErpInfo) {\r\n // teccom request are always from the \"default ERP system, useArticleExtendedDeliveryInfo\r\n if (info) {\r\n list.push({ ...info, erpSystem: defaultArticleErpInfo.erpSystem })\r\n } else {\r\n list.push({ ...defaultArticleErpInfo.response, erpSystem: defaultArticleErpInfo.erpSystem })\r\n }\r\n } else {\r\n list.push({ availability: { type: AvailabilityStatus.Unknown, shortDescription: translateText(12684) } })\r\n }\r\n if (alternativeArticleErpInfo) {\r\n list.push({ ...alternativeArticleErpInfo.response, erpSystem: alternativeArticleErpInfo.erpSystem })\r\n }\r\n return list\r\n }, [defaultArticleErpInfo, alternativeArticleErpInfo, translateText, info])\r\n\r\n return (\r\n