feat: use RTK Query to get order deails (#73)
This commit is contained in:
@@ -19,7 +19,7 @@ import { OrderStatus } from './status';
|
||||
|
||||
type OrderDetailsProps = Pick<
|
||||
Order.View,
|
||||
| 'id'
|
||||
| 'orderNumber'
|
||||
| 'status'
|
||||
| 'phone'
|
||||
| 'carNumber'
|
||||
@@ -32,7 +32,7 @@ type OrderDetailsProps = Pick<
|
||||
>;
|
||||
|
||||
export const OrderDetails: FC<OrderDetailsProps> = ({
|
||||
id,
|
||||
orderNumber,
|
||||
status,
|
||||
phone,
|
||||
carNumber,
|
||||
@@ -58,7 +58,7 @@ export const OrderDetails: FC<OrderDetailsProps> = ({
|
||||
gap={2}
|
||||
>
|
||||
<Heading as='h2' size='lg'>
|
||||
{t('title', { number: id })}
|
||||
{t('title', { number: orderNumber })}
|
||||
</Heading>
|
||||
<OrderStatus value={status} />
|
||||
</HStack>
|
||||
|
||||
@@ -15,19 +15,19 @@ const getPropsByStatus = (
|
||||
colorScheme: 'red',
|
||||
children: t('canceled'),
|
||||
};
|
||||
case 'progress':
|
||||
return {
|
||||
colorScheme: 'yellow',
|
||||
children: t('progress'),
|
||||
};
|
||||
case 'pending':
|
||||
return {
|
||||
colorScheme: 'yellow',
|
||||
children: t('pending'),
|
||||
};
|
||||
case 'progress':
|
||||
return {
|
||||
colorScheme: 'orange',
|
||||
children: t('progress'),
|
||||
};
|
||||
case 'working':
|
||||
return {
|
||||
colorScheme: 'yellow',
|
||||
colorScheme: 'orange',
|
||||
children: t('working'),
|
||||
};
|
||||
case 'complete':
|
||||
|
||||
Reference in New Issue
Block a user