import * as R from 'ramda' import React, { memo } from 'react' import { H2, Label1, P } from '../../../components/typography' import IdIcon from '../../../styling/icons/ID/card/zodiac.svg?react' import { getFormattedPhone, getName } from '../helper' import PhotosCard from './PhotosCard' const CustomerDetails = memo(({ customer, photosData, locale, timezone }) => { const idNumber = R.path(['idCardData', 'documentNumber'])(customer) const usSsn = R.path(['usSsn'])(customer) const name = getName(customer) const email = R.path(['email'])(customer) const phone = R.path(['phone'])(customer) const elements = [ { header: 'Phone number', size: 172, value: getFormattedPhone(customer.phone, locale.country), }, ] if (idNumber) elements.push({ header: 'ID number', size: 172, value: idNumber, }) if (usSsn) elements.push({ header: 'US SSN', size: 127, value: usSsn, }) if (email) elements.push({ header: 'Email', size: 190, value: email, }) return (

{name.length ? name : email?.length ? email : getFormattedPhone(phone, locale.country)}

{elements.map(({ size, header }, idx) => ( {header} ))}
{elements.map(({ size, value }, idx) => (

{value}

))}
) }) export default CustomerDetails