import React from 'react'

import { AddressProps } from './Address.types'

import './Address.css'

const Address = ({ data, className }: AddressProps) => {
  return (
    <p className={className + ' text-sm'}>
      {data.address_1 && <span className='block'>{data.address_1},</span>}
      {data.address_2 && <span className='block'>{data.address_2},</span>}
      {data.city && <span className='block'>{data.city},</span>}
      {data.county && <span>{data.county} </span>}{' '}
      {data.postcode && <span>{data.postcode}</span>}
    </p>
  )
}

export default Address
