up
This commit is contained in:
22
src/components/display/OrderStatus.tsx
Normal file
22
src/components/display/OrderStatus.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import {Tag} from "antd";
|
||||
import React from "react";
|
||||
import {OrderStatusType} from "@/typings";
|
||||
|
||||
|
||||
const OrderStatus = ({status}: { status?: OrderStatusType }) => {
|
||||
|
||||
const colorMapping = {
|
||||
pending: 'warning',
|
||||
fail: 'error',
|
||||
success: 'success',
|
||||
processing: 'processing'
|
||||
}
|
||||
|
||||
if(!status) return null;
|
||||
|
||||
return (
|
||||
<Tag color={colorMapping[status]}>{status}</Tag>
|
||||
)
|
||||
}
|
||||
|
||||
export default OrderStatus;
|
||||
Reference in New Issue
Block a user