Skip to content

Commit

Permalink
Add comment in prepare-page
Browse files Browse the repository at this point in the history
  • Loading branch information
am9zZWY committed Jun 28, 2024
1 parent d52d722 commit 0c62cf0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/app/admin/prepare/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ const Page = () => {
}
}, []);

const hasComment = (order) => {
return (
typeof order.comment === "string" &&
order.comment !== "" &&
order.comment.toLowerCase() !== "No comment".toLowerCase()
);
};

const actions = {
cancel: (_id) => {
updateOrderStatus(_id, 'cancelled');
Expand Down Expand Up @@ -133,6 +141,10 @@ const Page = () => {
</span>
</div>
</div>
{hasComment(order) && <div className="text-sm ml-2">
<span>Comment:</span>
<span className="pl-4 italic">{order.comment}</span>
</div>}
<div className="text-xs font-light text-gray-600">
{order.items && (
<table className="w-full text-left">
Expand Down

0 comments on commit 0c62cf0

Please sign in to comment.