Files
web/packages/booking-flow/lib/components/BookingConfirmation/Header/Actions/DownloadInvoice.tsx
Hrishikesh Vaipurkar 55e25d6c75 Merged in chore/SW-3397-move-confirmation-component-with (pull request #2759)
chore(SW-3397) Moved Confirmation component with Header to booking-flow package

* chore(SW-3397) Moved Confirmation component with Header to booking-flow package

* chore(SW-3397): Optimised code


Approved-by: Anton Gunnarsson
2025-09-04 13:07:11 +00:00

34 lines
924 B
TypeScript

"use client"
import { useIntl } from "react-intl"
import { useReactToPrint } from "react-to-print"
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
import { OldDSButton as Button } from "@scandic-hotels/design-system/OldDSButton"
import type { DownloadInvoiceProps } from "../../../../types/components/bookingConfirmation/actions/downloadInvoice"
export default function DownloadInvoice({ mainRef }: DownloadInvoiceProps) {
const intl = useIntl()
const reactToPrintFn = useReactToPrint({ contentRef: mainRef })
function downloadBooking() {
reactToPrintFn()
}
return (
<Button
intent="text"
onPress={downloadBooking}
size="small"
theme="base"
variant="icon"
wrapping
>
<MaterialIcon icon="download" color="CurrentColor" />
{intl.formatMessage({
defaultMessage: "Download invoice",
})}
</Button>
)
}