<template>
    <reviewBlock
        :customHeaderText="header"
        :content="displayContent" />
</template>

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

export default {
    name: 'customer-review',
    components: {
        reviewBlock
    },
    props: {
        cmsWidgetName: String,
        customer: Object
    },
    data() {
        return {};
    },
    computed: {
        displayContent() {
            return [this.fullName, this.email, this.phoneNumber, this.smsOptIn];
        },
        header() {
            return this.getCmsContent(this.cmsWidgetName, 'HeaderText');
        },
        fullName() {
            return `${this.customer?.firstName} ${this.customer?.lastName}`;
        },
        email() {
            return this.customer?.emailAddress;
        },
        phoneNumber() {
            return this.customer?.servicePhone;
        },
        smsOptIn() {
            return this.getCmsContent(this.cmsWidgetName, 'SubheaderText');
        }
    }
};
</script>
