import { useState, useEffect } from 'react'

interface ICard{
  firstname: string
  lastname: string
  email: string
}

function Card(props:ICard) {
  const [curr_card, setCard] = useState<ICard>({firstname:"Иван",lastname:"Петров", email:"email@test.ru"});
  useEffect(()=>{setCard(props);},[curr_card])
  return (
      <div className='block p-6 max-w-sm bg-gray-300
            rounded-lg border border-gray-500 align-items: center;'>
        <div className='text-4xl text-center'>{curr_card.lastname} {curr_card.firstname}</div>
        <div className='text-sm text-center'>{curr_card.email}</div>
      </div>
  )
}

export default Card