/* @flow */ import React from 'react' import classnames from 'classnames' import { buildAriaProps, buildCss, buildDataProps, } from '../utilities/props' import { spacing } from '../utilities/spacing.js' import { Caption, Contact, Person } from '../' type ContactItem = { contactType: String, contactValue: String, contactDetail: String, } type PersonContactProps = { aria?: object, className?: String | Array, dark?: Boolean, data?: object, firstName: String, id?: String, lastName: String, contacts?: Array, } const PersonContact = (props: PersonContactProps) => { const { aria = {}, className, contacts = [], data = {}, firstName, id, lastName, } = props const ariaProps = buildAriaProps(aria) const dataProps = buildDataProps(data) const classes = classnames(buildCss('pb_person_contact_kit'), className, spacing(props)) const wrongContacts = () => ( contacts.filter((contactObject) => ( contactObject.contactType === 'wrong-phone' )) ) const validContacts = () => ( contacts.filter((contactObject) => ( contactObject.contactType !== 'wrong-phone' )) ) return (
{validContacts().map((contactObject, index) => ( ))} {wrongContacts().map((contactObject, index) => ( <> ))}
) } export default PersonContact