Fix(SW-1711)/(SW-2077): Export icons individually * fix(SW-1711): export icons individually Approved-by: Michael Zetterberg Approved-by: Erik Tiekstra
33 lines
881 B
TypeScript
33 lines
881 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 Button from "@/components/TempDesignSystem/Button"
|
|
|
|
import type { DownloadInvoiceProps } from "@/types/components/hotelReservation/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({ id: "Download invoice" })}
|
|
</Button>
|
|
)
|
|
}
|