Feat/lokalise rebuild * chore(lokalise): update translation ids * chore(lokalise): easier to switch between projects * chore(lokalise): update translation ids * . * . * . * . * . * . * chore(lokalise): update translation ids * chore(lokalise): update translation ids * . * . * . * chore(lokalise): update translation ids * chore(lokalise): update translation ids * . * . * chore(lokalise): update translation ids * chore(lokalise): update translation ids * chore(lokalise): new translations * merge * switch to errors for missing id's * merge * sync translations Approved-by: Linus Flood
35 lines
975 B
TypeScript
35 lines
975 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({
|
|
id: "bookingConfirmation.downloadInvoice",
|
|
defaultMessage: "Download invoice",
|
|
})}
|
|
</Button>
|
|
)
|
|
}
|