import { makeStyles, Box } from '@material-ui/core' import * as R from 'ramda' import React, { memo } from 'react' import { SubpageButton } from 'src/components/buttons' import { H2, Label1, P } from 'src/components/typography' import { ReactComponent as IdIcon } from 'src/styling/icons/ID/card/zodiac.svg' import { ReactComponent as LawIconInverse } from 'src/styling/icons/circle buttons/law/white.svg' import { ReactComponent as LawIcon } from 'src/styling/icons/circle buttons/law/zodiac.svg' import mainStyles from '../CustomersList.styles' import { getFormattedPhone, getName } from '../helper' import FrontCameraPhoto from './FrontCameraPhoto' const useStyles = makeStyles(mainStyles) const CustomerDetails = memo(({ customer, locale, setShowCompliance }) => { const classes = useStyles() const idNumber = R.path(['idCardData', 'documentNumber'])(customer) const usSsn = R.path(['usSsn'])(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 }) const name = getName(customer) return (

{name.length ? name : getFormattedPhone(R.path(['phone'])(customer), locale.country)}

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

{value}

))}
) }) export default CustomerDetails