feat: ingredient product

This commit is contained in:
ferdiansyah783
2025-08-12 21:29:24 +07:00
parent c3780af341
commit f3dfad4cb3
36 changed files with 1731 additions and 465 deletions
@@ -16,6 +16,7 @@ import { formatShortCurrency } from '../../../utils/transform'
type Props = {
title: string
value: number
isCurrency: boolean
isLoading: boolean
avatarIcon: string
avatarSkin?: CustomAvatarProps['skin']
@@ -26,12 +27,12 @@ type Props = {
const DistributedBarChartOrder = ({
title,
value,
isCurrency = false,
isLoading,
avatarIcon,
avatarSkin,
avatarColor
}: Props) => {
if (isLoading) {
return <Skeleton sx={{ bgcolor: 'grey.100' }} variant='rectangular' width={300} height={118} />
}
@@ -45,7 +46,7 @@ const DistributedBarChartOrder = ({
{title}
</Typography>
<Typography color='text.primary' variant='h4'>
{formatShortCurrency(value)}
{isCurrency ? 'Rp ' + formatShortCurrency(value) : formatShortCurrency(value)}
</Typography>
</div>
<CustomAvatar variant='rounded' skin={avatarSkin} size={52} color={avatarColor}>
+1 -1
View File
@@ -33,7 +33,7 @@ const OrdersReport = ({ orderData, title }: { orderData: RecentSale[]; title: st
</tr>
</thead>
<tbody className='bg-white divide-y divide-gray-200'>
{orderData.map((sale, index) => (
{orderData && orderData.map((sale, index) => (
<tr key={index} className='hover:bg-gray-50'>
<td className='px-4 py-4 whitespace-nowrap text-sm font-medium text-gray-900'>
{formatDate(sale.date)}
@@ -19,7 +19,7 @@ const PaymentMethodReport = ({ payments }: { payments: PaymentDataItem[] }) => {
<h2 className='text-xl font-semibold text-gray-900'>Payment Methods</h2>
</div>
<div className='space-y-6'>
{payments.map(method => (
{payments && payments.map(method => (
<div key={method.payment_method_id} className='border-b border-gray-200 pb-4 last:border-b-0'>
<div className='flex justify-between items-center mb-2'>
<span className='text-sm font-medium text-gray-900'>{method.payment_method_name}</span>
@@ -34,7 +34,7 @@ const ProductSales = ({ productData, title }: { productData: ProductData[], titl
</tr>
</thead>
<tbody className='bg-white divide-y divide-gray-200'>
{productData.map((product, index) => (
{productData && productData.map((product, index) => (
<tr key={product.product_id} className='hover:bg-gray-50'>
<td className='px-4 py-4 whitespace-nowrap'>
<div className='flex items-center'>