<template>
    <reviewBlock :customHeaderText="header" :content="displayContent" @edit-clicked="editClicked" />
</template>

<script>
import reviewBlock from "@/layouts/payment-method/review-dropdown/review-block/review-block";

export default {
    name: "opt-in-review",
    props: {
        cmsWidgetName: String,
        customer: Object,
    },
    data() {
        return {};
    },
    methods: {
        editClicked() {
            this.$emit("edit-clicked");
        },
    },
    computed: {
        displayContent() {
            return [
                this.getCmsContent(this.cmsWidgetName, "BodyText")?.replaceAll(
                    "{custom:SMSNUMBER}",
                    this.phoneNumber
                ),
            ];
        },
        header() {
            return this.getCmsContent(this.cmsWidgetName, "HeaderText");
        },
        phoneNumber() {
            return this.customer?.phoneNumber;
        },
    },
    components: {
        reviewBlock,
    },
};
</script>
