import React from 'react';
import { Badge, Link, Stack, Td, Tr } from '@chakra-ui/react';
import MasterActionsMenu from '../MasterActionsMenu';

const MasterItem = ({ name, schedule, phone }) => {
  return (
    <Tr>
      <Td>{name}</Td>
      <Td>
        <Stack direction='row'>
          {schedule.map((time, index) => (
            <Badge colorScheme={'green'} key={index}>
              {time}
            </Badge>
          ))}
        </Stack>
      </Td>
      <Td>
        <Link href='tel:'>{phone}</Link>
      </Td>
      <Td>
        <MasterActionsMenu />
      </Td>
    </Tr>
  );
};

export default MasterItem;
