Files
web/apps/scandic-web/components/Blocks/DynamicContent/Rewards/Redeem/Flows/Campaign.tsx
T
Bianca Widstam d9ec1b1f2d Merged in chore/BOOK-739-replace-caption (pull request #3428)
chore(BOOK-739): replace caption with typography

* chore(BOOK-739): replace caption with typography

* chore(BOOK-739): refactor div

* chore(BOOK-739): refactor badge

* chore(BOOK-739): remove span

* chore(BOOK-739): skeleton update

* chore(BOOK-739): update

* chore(BOOK-739): update reward

* chore(BOOK-739): update voucher currency


Approved-by: Erik Tiekstra
2026-01-14 09:33:27 +00:00

82 lines
2.5 KiB
TypeScript

"use client"
import { useIntl } from "react-intl"
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
import { OldDSButton as Button } from "@scandic-hotels/design-system/OldDSButton"
import { toast } from "@scandic-hotels/design-system/Toast"
import { Typography } from "@scandic-hotels/design-system/Typography"
import { RewardIcon } from "../../RewardIcon"
import styles from "../redeem.module.css"
import type { Campaign } from "@scandic-hotels/trpc/types/rewards"
export default function Campaign({ reward }: { reward: Campaign }) {
const intl = useIntl()
return (
<>
<div className={styles.modalContent}>
<RewardIcon rewardId={reward.reward_id} />
<Typography variant="Title/smLowCase" className={styles.rewardLabel}>
<h3>{reward.label}</h3>
</Typography>
<Typography
variant="Body/Paragraph/mdRegular"
className={styles.rewardDescription}
>
<p>{reward.description}</p>
</Typography>
<div className={styles.rewardBadge}>
<Typography variant="Body/Supporting text (caption)/smBold">
<p>
{intl.formatMessage({
id: "redeemFlow.promoCode",
defaultMessage: "Promo code",
})}
</p>
</Typography>
<Typography variant="Body/Supporting text (caption)/smRegular">
<p>{reward.operaRewardId}</p>
</Typography>
</div>
</div>
<footer className={styles.modalFooter}>
<Button
onClick={() => {
try {
navigator.clipboard.writeText(reward.operaRewardId)
toast.success(
intl.formatMessage({
id: "redeemFlow.copiedToClipboard",
defaultMessage: "Copied to clipboard",
})
)
} catch {
toast.error(
intl.formatMessage({
id: "errorMessage.copyFailed",
defaultMessage: "Failed to copy",
})
)
}
}}
type="button"
variant="icon"
size="small"
theme="base"
intent="primary"
>
<MaterialIcon icon="content_copy" color="CurrentColor" />
{intl.formatMessage({
id: "redeemFlow.copyPromotionCode",
defaultMessage: "Copy promotion code",
})}
</Button>
</footer>
</>
)
}