feat(SW-2084) logic to disable Manage stay options * feat(SW-2084) logic to disable Manage stay options * feat(SW-2084) cleanup logic for checks * feat(SW-2084) check if date has passed * feat(SW-2084) change to datetimeIsInThePast Approved-by: Niclas Edenvin
39 lines
835 B
TypeScript
39 lines
835 B
TypeScript
"use client"
|
|
|
|
import { useIntl } from "react-intl"
|
|
|
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons"
|
|
|
|
import Button from "@/components/TempDesignSystem/Button"
|
|
import { trackMyStayPageLink } from "@/utils/tracking"
|
|
|
|
import styles from "../actionPanel.module.css"
|
|
|
|
export default function AddToCalendarButton({
|
|
onPress,
|
|
disabled,
|
|
}: {
|
|
onPress: () => void
|
|
disabled?: boolean
|
|
}) {
|
|
const intl = useIntl()
|
|
|
|
const handleAddToCalendar = () => {
|
|
trackMyStayPageLink("add to calendar")
|
|
onPress()
|
|
}
|
|
|
|
return (
|
|
<Button
|
|
variant="icon"
|
|
intent="text"
|
|
className={styles.button}
|
|
onPress={handleAddToCalendar}
|
|
disabled={disabled}
|
|
>
|
|
{intl.formatMessage({ id: "Add to calendar" })}
|
|
<MaterialIcon icon="calendar_add_on" color="CurrentColor" />
|
|
</Button>
|
|
)
|
|
}
|