Compare commits
No commits in common. "fc699e7890c225be09f24707103ae3555f8af078" and "5498122109db3eff3559f4fe6162f35992eabb58" have entirely different histories.
fc699e7890
...
5498122109
@ -3,7 +3,7 @@ import { Td, Tr, Link, Select } from '@chakra-ui/react';
|
|||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
|
|
||||||
import { getTimeSlot } from '../../lib';
|
import { getTimeSlot } from '../../lib/date-helpers';
|
||||||
|
|
||||||
const statuses = [
|
const statuses = [
|
||||||
'pending' as const,
|
'pending' as const,
|
||||||
@ -26,16 +26,6 @@ export type OrderProps = {
|
|||||||
location?: string;
|
location?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
type Status = (typeof statuses)[number];
|
|
||||||
|
|
||||||
const statusColors: Record<Status, string> = {
|
|
||||||
pending: 'yellow.100',
|
|
||||||
progress: 'blue.100',
|
|
||||||
working: 'orange.100',
|
|
||||||
canceled: 'red.100',
|
|
||||||
complete: 'green.100',
|
|
||||||
};
|
|
||||||
|
|
||||||
const OrderItem = ({
|
const OrderItem = ({
|
||||||
carNumber,
|
carNumber,
|
||||||
startWashTime,
|
startWashTime,
|
||||||
@ -50,7 +40,6 @@ const OrderItem = ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const [statusSelect, setStatus] = useState(status);
|
const [statusSelect, setStatus] = useState(status);
|
||||||
const bgColor = statusColors[statusSelect];
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Tr>
|
<Tr>
|
||||||
@ -62,7 +51,6 @@ const OrderItem = ({
|
|||||||
value={statusSelect}
|
value={statusSelect}
|
||||||
onChange={(e) => setStatus(e.target.value as OrderProps['status'])}
|
onChange={(e) => setStatus(e.target.value as OrderProps['status'])}
|
||||||
placeholder={t(`status.placeholder`)}
|
placeholder={t(`status.placeholder`)}
|
||||||
bg={bgColor}
|
|
||||||
>
|
>
|
||||||
{statuses.map((status) => (
|
{statuses.map((status) => (
|
||||||
<option key={status} value={status}>
|
<option key={status} value={status}>
|
||||||
|
Loading…
Reference in New Issue
Block a user