Skip to content

Commit

Permalink
๐ŸŽจ OrderSummary ์ปดํฌ๋„ŒํŠธ์—์„œ ๋ถˆํ•„์š”ํ•œ return ์ œ๊ฑฐ
Browse files Browse the repository at this point in the history
- ๋‹จ์ผ JSX ๋ฐ˜ํ™˜ ๊ตฌ์กฐ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ฝ”๋“œ ๊ฐ„๊ฒฐํ™”
- return ํ‚ค์›Œ๋“œ ๋ฐ ์ค‘๊ด„ํ˜ธ ์‚ญ์ œ
  • Loading branch information
pitangland committed Jan 15, 2025
1 parent 699a740 commit 6df89c1
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/refactoring/components/OrderSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ export const OrderSummary = ({
totalBeforeDiscount,
totalAfterDiscount,
totalDiscount,
}: OrderSummaryProps) => {
return (
<div className='mt-6 bg-white p-4 rounded shadow'>
<h2 className='text-2xl font-semibold mb-2'>์ฃผ๋ฌธ ์š”์•ฝ</h2>
<div className='space-y-1'>
<p>์ƒํ’ˆ ๊ธˆ์•ก: {totalBeforeDiscount.toLocaleString()}์›</p>
<p className='text-green-600'>ํ• ์ธ ๊ธˆ์•ก: {totalDiscount.toLocaleString()}์›</p>
<p className='text-xl font-bold'>์ตœ์ข… ๊ฒฐ์ œ ๊ธˆ์•ก: {totalAfterDiscount.toLocaleString()}์›</p>
</div>
}: OrderSummaryProps) => (
<div className='mt-6 bg-white p-4 rounded shadow'>
<h2 className='text-2xl font-semibold mb-2'>์ฃผ๋ฌธ ์š”์•ฝ</h2>
<div className='space-y-1'>
<p>์ƒํ’ˆ ๊ธˆ์•ก: {totalBeforeDiscount.toLocaleString()}์›</p>
<p className='text-green-600'>ํ• ์ธ ๊ธˆ์•ก: {totalDiscount.toLocaleString()}์›</p>
<p className='text-xl font-bold'>์ตœ์ข… ๊ฒฐ์ œ ๊ธˆ์•ก: {totalAfterDiscount.toLocaleString()}์›</p>
</div>
);
};
</div>
);

0 comments on commit 6df89c1

Please sign in to comment.