All checks were successful
it-academy/dry-wash-pl/pipeline/pr-main This commit looks good
44 lines
1011 B
TypeScript
44 lines
1011 B
TypeScript
import React, { useState } from 'react';
|
|
import { Td, Tr, Link, Select } from '@chakra-ui/react';
|
|
import i18next from 'i18next';
|
|
|
|
const statuses = ['pending', 'progress', 'working', 'canceled', 'complete'];
|
|
|
|
const OrderItem = ({
|
|
carNumber,
|
|
washTime,
|
|
orderDate,
|
|
status,
|
|
phone,
|
|
location,
|
|
}) => {
|
|
const [statusSelect, setStatus] = useState(status);
|
|
|
|
return (
|
|
<Tr>
|
|
<Td>{carNumber}</Td>
|
|
<Td>{washTime}</Td>
|
|
<Td>{orderDate}</Td>
|
|
<Td>
|
|
<Select
|
|
value={statusSelect}
|
|
onChange={(e) => setStatus(e.target.value)}
|
|
placeholder={i18next.t(`dry-wash.arm.order.status.placeholder`)}
|
|
>
|
|
{statuses.map((status) => (
|
|
<option key={status} value={status}>
|
|
{i18next.t(`dry-wash.arm.order.status.${status}`)}
|
|
</option>
|
|
))}
|
|
</Select>
|
|
</Td>
|
|
<Td>
|
|
<Link href='tel:'>{phone}</Link>
|
|
</Td>
|
|
<Td>{location}</Td>
|
|
</Tr>
|
|
);
|
|
};
|
|
|
|
export default OrderItem;
|