feat: SW-602 Implemented no availability states

This commit is contained in:
Hrishikesh Vaipurkar
2024-11-14 23:20:04 +01:00
parent dc3516f4e1
commit a17010a431
14 changed files with 144 additions and 38 deletions

View File

@@ -1,8 +1,10 @@
"use client"
import { useRef, useState } from "react"
import { Button } from "react-aria-components"
import { useIntl } from "react-intl"
import { CheckIcon, InfoCircleIcon } from "@/components/Icons"
import Label from "@/components/TempDesignSystem/Form/Label"
import Caption from "@/components/TempDesignSystem/Text/Caption"
import PricePopover from "./Popover"
@@ -27,6 +29,7 @@ export default function FlexibilityOption({
const [isPopoverOpen, setIsPopoverOpen] = useState(false)
let triggerRef = useRef<HTMLButtonElement>(null)
const buttonClickedRef = useRef(false)
const intl = useIntl()
function setRef(node: Element | null) {
if (node) {
@@ -36,13 +39,17 @@ export default function FlexibilityOption({
if (!product) {
return (
<div className={styles.disabledCard}>
<div className={styles.noPricesCard}>
<div className={styles.header}>
<InfoCircleIcon width={16} height={16} color="uiTextMediumContrast" />
<Caption color="disabled">{name}</Caption>
<Caption color="disabled">({paymentTerm})</Caption>
<Caption>{name}</Caption>
<Caption color="uiTextPlaceholder">({paymentTerm})</Caption>
</div>
<PriceTable />
<Label size="regular" className={styles.noPricesLabel}>
<Caption color="uiTextHighContrast" type="bold">
{intl.formatMessage({ id: "No Prices available" })}
</Caption>
</Label>
</div>
)
}