Sha256: af89aec4bf0817f8ebdce9f9ecb4ad8569be2a3e2920a3353ed14bf876c0804e

Contents?: true

Size: 1023 Bytes

Versions: 1

Compression:

Stored size: 1023 Bytes

Contents

/* @flow */
/*eslint-disable react/no-multi-comp, flowtype/space-before-type-colon */

import React from 'react'
import classnames from 'classnames'

import {
  Person,
  Contact,
} from '../'

type PersonContactProps = {
  className?: String | Array<String>,
  dark?: Boolean,
  firstName: String,
  lastName: String,
  contacts?: Array<{contactType: String, contactValue: String}>,
}

const contactsArray = ({contacts=[]}: PersonContactProps) => {
  return contacts.map((contactObject, index) => {
    return (
      <Contact
        contactType={contactObject.contactType}
        contactValue={contactObject.contactValue}
      />
    );
  })
}

const PersonContact = ({
  className,
  dark=false,
  firstName,
  lastName,
  contacts,
}: PersonContactProps) => {

  const contactKits = contactsArray({contacts})

  return (
    <div className={classnames('pb_person_contact_kit', className)}>
      <Person firstName={firstName} lastName={lastName} />
      {contactKits}
    </div>
  )
}

export default PersonContact

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
playbook_ui-2.9.3 app/pb_kits/playbook/pb_person_contact/_person_contact.jsx