feat: add fetch for multi-stub (#59)
Some checks failed
it-academy/dry-wash-pl/pipeline/head There was a failure building this commit
it-academy/dry-wash-pl/pipeline/pr-main There was a failure building this commit

This commit is contained in:
2024-12-22 12:00:12 +03:00
parent fc699e7890
commit 6096cfc15c
10 changed files with 205 additions and 59 deletions

View File

@@ -4,37 +4,30 @@ import { Badge, Link, Stack, Td, Tr } from '@chakra-ui/react';
import MasterActionsMenu from '../MasterActionsMenu';
import { getTimeSlot } from '../../lib/date-helpers';
export interface Schedule {
id: string;
startWashTime: string;
endWashTime: string;
}
export type MasterProps = {
id: string;
name: string;
schedule: Schedule[];
phone: string;
};
const MasterItem = ({ name, schedule, phone }) => {
const MasterItem = ({ name, phone, id }) => {
return (
<Tr>
<Td>{name}</Td>
<Td>
<Stack direction='row'>
{schedule.map(({ startWashTime, endWashTime }, index) => (
<Badge colorScheme={'green'} key={index}>
{getTimeSlot(startWashTime, endWashTime)}
</Badge>
))}
{/*{schedule.map(({ startWashTime, endWashTime }, index) => (*/}
{/* <Badge colorScheme={'green'} key={index}>*/}
{/* {getTimeSlot(startWashTime, endWashTime)}*/}
{/* </Badge>*/}
{/*))}*/}
</Stack>
</Td>
<Td>
<Link href='tel:'>{phone}</Link>
</Td>
<Td>
<MasterActionsMenu />
<MasterActionsMenu id={id} />
</Td>
</Tr>
);