efril #13
@ -0,0 +1,7 @@
|
||||
import CampaignListTable from '@/views/apps/marketing/campaign/CampaignListTable'
|
||||
|
||||
const CampaignPage = () => {
|
||||
return <CampaignListTable />
|
||||
}
|
||||
|
||||
export default CampaignPage
|
||||
@ -161,6 +161,7 @@ const VerticalMenu = ({ dictionary, scrollMenu }: Props) => {
|
||||
{dictionary['navigation'].wheel_spin}
|
||||
</MenuItem>
|
||||
</SubMenu>
|
||||
<MenuItem href={`/${locale}/apps/marketing/campaign`}>{dictionary['navigation'].campaign}</MenuItem>
|
||||
</SubMenu>
|
||||
<SubMenu label={dictionary['navigation'].inventory} icon={<i className='tabler-salad' />}>
|
||||
<SubMenu label={dictionary['navigation'].products}>
|
||||
|
||||
@ -131,6 +131,7 @@
|
||||
"loyalty": "Loyalty",
|
||||
"reward": "Reward",
|
||||
"gamification": "Gamification",
|
||||
"wheel_spin": "Wheel Spin"
|
||||
"wheel_spin": "Wheel Spin",
|
||||
"campaign": "Campaign"
|
||||
}
|
||||
}
|
||||
|
||||
@ -131,6 +131,7 @@
|
||||
"loyalty": "Loyalti",
|
||||
"reward": "Reward",
|
||||
"gamification": "Gamifikasi",
|
||||
"wheel_spin": "Wheel Spin"
|
||||
"wheel_spin": "Wheel Spin",
|
||||
"campaign": "Kampanye"
|
||||
}
|
||||
}
|
||||
|
||||
13
src/types/services/campaign.ts
Normal file
13
src/types/services/campaign.ts
Normal file
@ -0,0 +1,13 @@
|
||||
export interface Campaign {
|
||||
id: string
|
||||
name: string
|
||||
description?: string
|
||||
minimumPurchase: number
|
||||
rewardType: 'point' | 'voucher' | 'discount'
|
||||
rewardValue: number
|
||||
startDate: Date
|
||||
endDate: Date
|
||||
isActive: boolean
|
||||
createdAt: Date
|
||||
updatedAt: Date
|
||||
}
|
||||
576
src/views/apps/marketing/campaign/AddEditCampaignDrawer.tsx
Normal file
576
src/views/apps/marketing/campaign/AddEditCampaignDrawer.tsx
Normal file
@ -0,0 +1,576 @@
|
||||
// React Imports
|
||||
import { useState, useEffect } from 'react'
|
||||
|
||||
// MUI Imports
|
||||
import Button from '@mui/material/Button'
|
||||
import Drawer from '@mui/material/Drawer'
|
||||
import IconButton from '@mui/material/IconButton'
|
||||
import MenuItem from '@mui/material/MenuItem'
|
||||
import Typography from '@mui/material/Typography'
|
||||
import Divider from '@mui/material/Divider'
|
||||
import Grid from '@mui/material/Grid2'
|
||||
import Box from '@mui/material/Box'
|
||||
import Switch from '@mui/material/Switch'
|
||||
import FormControlLabel from '@mui/material/FormControlLabel'
|
||||
import Chip from '@mui/material/Chip'
|
||||
import InputAdornment from '@mui/material/InputAdornment'
|
||||
|
||||
// Third-party Imports
|
||||
import { useForm, Controller, useFieldArray } from 'react-hook-form'
|
||||
|
||||
// Component Imports
|
||||
import CustomTextField from '@core/components/mui/TextField'
|
||||
|
||||
// Types
|
||||
export interface Campaign {
|
||||
id: string
|
||||
name: string
|
||||
description?: string
|
||||
minimumPurchase: number
|
||||
rewardType: 'point' | 'voucher' | 'discount'
|
||||
rewardValue: number
|
||||
startDate: Date
|
||||
endDate: Date
|
||||
isActive: boolean
|
||||
createdAt: Date
|
||||
updatedAt: Date
|
||||
}
|
||||
|
||||
export interface CampaignRequest {
|
||||
name: string
|
||||
description?: string
|
||||
minimumPurchase: number
|
||||
rewardType: 'point' | 'voucher' | 'discount'
|
||||
rewardValue: number
|
||||
startDate: Date
|
||||
endDate: Date
|
||||
isActive: boolean
|
||||
}
|
||||
|
||||
type Props = {
|
||||
open: boolean
|
||||
handleClose: () => void
|
||||
data?: Campaign // Data campaign untuk edit (jika ada)
|
||||
}
|
||||
|
||||
type FormValidateType = {
|
||||
name: string
|
||||
description: string
|
||||
minimumPurchase: number
|
||||
rewardType: 'point' | 'voucher' | 'discount'
|
||||
rewardValue: number
|
||||
startDate: string
|
||||
endDate: string
|
||||
isActive: boolean
|
||||
}
|
||||
|
||||
// Initial form data
|
||||
const initialData: FormValidateType = {
|
||||
name: '',
|
||||
description: '',
|
||||
minimumPurchase: 0,
|
||||
rewardType: 'point',
|
||||
rewardValue: 0,
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
isActive: true
|
||||
}
|
||||
|
||||
// Mock mutation hooks (replace with actual hooks)
|
||||
const useCampaignMutation = () => {
|
||||
const createCampaign = {
|
||||
mutate: (data: CampaignRequest, options?: { onSuccess?: () => void }) => {
|
||||
console.log('Creating campaign:', data)
|
||||
setTimeout(() => options?.onSuccess?.(), 1000)
|
||||
}
|
||||
}
|
||||
|
||||
const updateCampaign = {
|
||||
mutate: (data: { id: string; payload: CampaignRequest }, options?: { onSuccess?: () => void }) => {
|
||||
console.log('Updating campaign:', data)
|
||||
setTimeout(() => options?.onSuccess?.(), 1000)
|
||||
}
|
||||
}
|
||||
|
||||
return { createCampaign, updateCampaign }
|
||||
}
|
||||
|
||||
const AddEditCampaignDrawer = (props: Props) => {
|
||||
// Props
|
||||
const { open, handleClose, data } = props
|
||||
|
||||
// States
|
||||
const [showMore, setShowMore] = useState(false)
|
||||
const [isSubmitting, setIsSubmitting] = useState(false)
|
||||
|
||||
const { createCampaign, updateCampaign } = useCampaignMutation()
|
||||
|
||||
// Determine if this is edit mode
|
||||
const isEditMode = Boolean(data?.id)
|
||||
|
||||
// Hooks
|
||||
const {
|
||||
control,
|
||||
reset: resetForm,
|
||||
handleSubmit,
|
||||
watch,
|
||||
setValue,
|
||||
formState: { errors }
|
||||
} = useForm<FormValidateType>({
|
||||
defaultValues: initialData
|
||||
})
|
||||
|
||||
const watchedRewardType = watch('rewardType')
|
||||
const watchedStartDate = watch('startDate')
|
||||
const watchedEndDate = watch('endDate')
|
||||
|
||||
// Effect to populate form when editing
|
||||
useEffect(() => {
|
||||
if (isEditMode && data) {
|
||||
// Populate form with existing data
|
||||
const formData: FormValidateType = {
|
||||
name: data.name || '',
|
||||
description: data.description || '',
|
||||
minimumPurchase: data.minimumPurchase || 0,
|
||||
rewardType: data.rewardType || 'point',
|
||||
rewardValue: data.rewardValue || 0,
|
||||
startDate: data.startDate ? new Date(data.startDate).toISOString().split('T')[0] : '',
|
||||
endDate: data.endDate ? new Date(data.endDate).toISOString().split('T')[0] : '',
|
||||
isActive: data.isActive ?? true
|
||||
}
|
||||
|
||||
resetForm(formData)
|
||||
setShowMore(true) // Always show more for edit mode
|
||||
} else {
|
||||
// Reset to initial data for add mode
|
||||
resetForm(initialData)
|
||||
setShowMore(false)
|
||||
}
|
||||
}, [data, isEditMode, resetForm])
|
||||
|
||||
const handleFormSubmit = async (formData: FormValidateType) => {
|
||||
try {
|
||||
setIsSubmitting(true)
|
||||
|
||||
// Create CampaignRequest object
|
||||
const campaignRequest: CampaignRequest = {
|
||||
name: formData.name,
|
||||
description: formData.description || undefined,
|
||||
minimumPurchase: formData.minimumPurchase,
|
||||
rewardType: formData.rewardType,
|
||||
rewardValue: formData.rewardValue,
|
||||
startDate: new Date(formData.startDate),
|
||||
endDate: new Date(formData.endDate),
|
||||
isActive: formData.isActive
|
||||
}
|
||||
|
||||
if (isEditMode && data?.id) {
|
||||
// Update existing campaign
|
||||
updateCampaign.mutate(
|
||||
{ id: data.id, payload: campaignRequest },
|
||||
{
|
||||
onSuccess: () => {
|
||||
handleReset()
|
||||
handleClose()
|
||||
}
|
||||
}
|
||||
)
|
||||
} else {
|
||||
// Create new campaign
|
||||
createCampaign.mutate(campaignRequest, {
|
||||
onSuccess: () => {
|
||||
handleReset()
|
||||
handleClose()
|
||||
}
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error submitting campaign:', error)
|
||||
// Handle error (show toast, etc.)
|
||||
} finally {
|
||||
setIsSubmitting(false)
|
||||
}
|
||||
}
|
||||
|
||||
const handleReset = () => {
|
||||
handleClose()
|
||||
resetForm(initialData)
|
||||
setShowMore(false)
|
||||
}
|
||||
|
||||
const formatCurrency = (value: number) => {
|
||||
return new Intl.NumberFormat('id-ID', {
|
||||
style: 'currency',
|
||||
currency: 'IDR',
|
||||
minimumFractionDigits: 0
|
||||
}).format(value)
|
||||
}
|
||||
|
||||
const getRewardTypeLabel = (type: 'point' | 'voucher' | 'discount') => {
|
||||
switch (type) {
|
||||
case 'point':
|
||||
return 'Poin'
|
||||
case 'voucher':
|
||||
return 'Voucher'
|
||||
case 'discount':
|
||||
return 'Diskon'
|
||||
default:
|
||||
return type
|
||||
}
|
||||
}
|
||||
|
||||
const getRewardValuePlaceholder = (type: 'point' | 'voucher' | 'discount') => {
|
||||
switch (type) {
|
||||
case 'point':
|
||||
return 'Jumlah poin yang diberikan'
|
||||
case 'voucher':
|
||||
return 'Nilai voucher dalam Rupiah'
|
||||
case 'discount':
|
||||
return 'Persentase diskon (1-100)'
|
||||
default:
|
||||
return 'Nilai reward'
|
||||
}
|
||||
}
|
||||
|
||||
const getRewardValueRules = (type: 'point' | 'voucher' | 'discount') => {
|
||||
const baseRules = {
|
||||
required: 'Nilai reward wajib diisi',
|
||||
min: {
|
||||
value: 1,
|
||||
message: 'Nilai reward minimal 1'
|
||||
}
|
||||
}
|
||||
|
||||
if (type === 'discount') {
|
||||
return {
|
||||
...baseRules,
|
||||
max: {
|
||||
value: 100,
|
||||
message: 'Persentase diskon maksimal 100%'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return baseRules
|
||||
}
|
||||
|
||||
return (
|
||||
<Drawer
|
||||
open={open}
|
||||
anchor='right'
|
||||
variant='temporary'
|
||||
onClose={handleReset}
|
||||
ModalProps={{ keepMounted: true }}
|
||||
sx={{
|
||||
'& .MuiDrawer-paper': {
|
||||
width: { xs: 300, sm: 400 },
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
height: '100%'
|
||||
}
|
||||
}}
|
||||
>
|
||||
{/* Sticky Header */}
|
||||
<Box
|
||||
sx={{
|
||||
position: 'sticky',
|
||||
top: 0,
|
||||
zIndex: 10,
|
||||
backgroundColor: 'background.paper',
|
||||
borderBottom: 1,
|
||||
borderColor: 'divider'
|
||||
}}
|
||||
>
|
||||
<div className='flex items-center justify-between plb-5 pli-6'>
|
||||
<Typography variant='h5'>{isEditMode ? 'Edit Kampanye' : 'Tambah Kampanye Baru'}</Typography>
|
||||
<IconButton size='small' onClick={handleReset}>
|
||||
<i className='tabler-x text-2xl text-textPrimary' />
|
||||
</IconButton>
|
||||
</div>
|
||||
</Box>
|
||||
|
||||
{/* Scrollable Content */}
|
||||
<Box sx={{ flex: 1, overflowY: 'auto' }}>
|
||||
<form id='campaign-form' onSubmit={handleSubmit(handleFormSubmit)}>
|
||||
<div className='flex flex-col gap-6 p-6'>
|
||||
{/* Nama Kampanye */}
|
||||
<div>
|
||||
<Typography variant='body2' className='mb-2'>
|
||||
Nama Kampanye <span className='text-red-500'>*</span>
|
||||
</Typography>
|
||||
<Controller
|
||||
name='name'
|
||||
control={control}
|
||||
rules={{ required: 'Nama kampanye wajib diisi' }}
|
||||
render={({ field }) => (
|
||||
<CustomTextField
|
||||
{...field}
|
||||
fullWidth
|
||||
placeholder='Masukkan nama kampanye'
|
||||
error={!!errors.name}
|
||||
helperText={errors.name?.message}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Minimum Purchase */}
|
||||
<div>
|
||||
<Typography variant='body2' className='mb-2'>
|
||||
Minimum Pembelian <span className='text-red-500'>*</span>
|
||||
</Typography>
|
||||
<Controller
|
||||
name='minimumPurchase'
|
||||
control={control}
|
||||
rules={{
|
||||
required: 'Minimum pembelian wajib diisi',
|
||||
min: {
|
||||
value: 0,
|
||||
message: 'Minimum pembelian tidak boleh negatif'
|
||||
}
|
||||
}}
|
||||
render={({ field }) => (
|
||||
<CustomTextField
|
||||
{...field}
|
||||
fullWidth
|
||||
type='number'
|
||||
placeholder='0'
|
||||
error={!!errors.minimumPurchase}
|
||||
helperText={errors.minimumPurchase?.message || (field.value > 0 ? formatCurrency(field.value) : '')}
|
||||
InputProps={{
|
||||
startAdornment: <InputAdornment position='start'>Rp</InputAdornment>
|
||||
}}
|
||||
onChange={e => field.onChange(Number(e.target.value))}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Jenis Reward */}
|
||||
<div>
|
||||
<Typography variant='body2' className='mb-2'>
|
||||
Jenis Reward <span className='text-red-500'>*</span>
|
||||
</Typography>
|
||||
<Controller
|
||||
name='rewardType'
|
||||
control={control}
|
||||
rules={{ required: 'Jenis reward wajib dipilih' }}
|
||||
render={({ field }) => (
|
||||
<CustomTextField
|
||||
{...field}
|
||||
select
|
||||
fullWidth
|
||||
error={!!errors.rewardType}
|
||||
helperText={errors.rewardType?.message}
|
||||
>
|
||||
<MenuItem value='point'>
|
||||
<div className='flex items-center gap-2'>
|
||||
<i className='tabler-coins text-primary' />
|
||||
Poin
|
||||
</div>
|
||||
</MenuItem>
|
||||
<MenuItem value='voucher'>
|
||||
<div className='flex items-center gap-2'>
|
||||
<i className='tabler-ticket text-success' />
|
||||
Voucher
|
||||
</div>
|
||||
</MenuItem>
|
||||
<MenuItem value='discount'>
|
||||
<div className='flex items-center gap-2'>
|
||||
<i className='tabler-percentage text-warning' />
|
||||
Diskon
|
||||
</div>
|
||||
</MenuItem>
|
||||
</CustomTextField>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Nilai Reward */}
|
||||
<div>
|
||||
<Typography variant='body2' className='mb-2'>
|
||||
Nilai {getRewardTypeLabel(watchedRewardType)} <span className='text-red-500'>*</span>
|
||||
</Typography>
|
||||
<Controller
|
||||
name='rewardValue'
|
||||
control={control}
|
||||
rules={getRewardValueRules(watchedRewardType)}
|
||||
render={({ field }) => (
|
||||
<CustomTextField
|
||||
{...field}
|
||||
fullWidth
|
||||
type='number'
|
||||
placeholder={getRewardValuePlaceholder(watchedRewardType)}
|
||||
error={!!errors.rewardValue}
|
||||
helperText={errors.rewardValue?.message}
|
||||
InputProps={{
|
||||
startAdornment:
|
||||
watchedRewardType === 'voucher' ? (
|
||||
<InputAdornment position='start'>Rp</InputAdornment>
|
||||
) : undefined,
|
||||
endAdornment:
|
||||
watchedRewardType === 'discount' ? (
|
||||
<InputAdornment position='end'>%</InputAdornment>
|
||||
) : watchedRewardType === 'point' ? (
|
||||
<InputAdornment position='end'>Poin</InputAdornment>
|
||||
) : undefined
|
||||
}}
|
||||
onChange={e => field.onChange(Number(e.target.value))}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Tanggal Mulai */}
|
||||
<div>
|
||||
<Typography variant='body2' className='mb-2'>
|
||||
Tanggal Mulai <span className='text-red-500'>*</span>
|
||||
</Typography>
|
||||
<Controller
|
||||
name='startDate'
|
||||
control={control}
|
||||
rules={{ required: 'Tanggal mulai wajib diisi' }}
|
||||
render={({ field }) => (
|
||||
<CustomTextField
|
||||
{...field}
|
||||
fullWidth
|
||||
type='date'
|
||||
error={!!errors.startDate}
|
||||
helperText={errors.startDate?.message}
|
||||
InputLabelProps={{
|
||||
shrink: true
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Tanggal Berakhir */}
|
||||
<div>
|
||||
<Typography variant='body2' className='mb-2'>
|
||||
Tanggal Berakhir <span className='text-red-500'>*</span>
|
||||
</Typography>
|
||||
<Controller
|
||||
name='endDate'
|
||||
control={control}
|
||||
rules={{
|
||||
required: 'Tanggal berakhir wajib diisi',
|
||||
validate: value => {
|
||||
if (watchedStartDate && value) {
|
||||
return (
|
||||
new Date(value) >= new Date(watchedStartDate) || 'Tanggal berakhir harus setelah tanggal mulai'
|
||||
)
|
||||
}
|
||||
return true
|
||||
}
|
||||
}}
|
||||
render={({ field }) => (
|
||||
<CustomTextField
|
||||
{...field}
|
||||
fullWidth
|
||||
type='date'
|
||||
error={!!errors.endDate}
|
||||
helperText={errors.endDate?.message}
|
||||
InputLabelProps={{
|
||||
shrink: true
|
||||
}}
|
||||
inputProps={{
|
||||
min: watchedStartDate || undefined
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Status Aktif */}
|
||||
<div>
|
||||
<Controller
|
||||
name='isActive'
|
||||
control={control}
|
||||
render={({ field }) => (
|
||||
<FormControlLabel
|
||||
control={<Switch checked={field.value} onChange={field.onChange} color='primary' />}
|
||||
label='Kampanye Aktif'
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Tampilkan selengkapnya */}
|
||||
{!showMore && (
|
||||
<Button
|
||||
variant='text'
|
||||
color='primary'
|
||||
size='small'
|
||||
sx={{ textTransform: 'none', fontSize: '14px', p: 0, textAlign: 'left', width: '200px' }}
|
||||
onClick={() => setShowMore(true)}
|
||||
>
|
||||
+ Tampilkan selengkapnya
|
||||
</Button>
|
||||
)}
|
||||
|
||||
{/* Konten tambahan */}
|
||||
{showMore && (
|
||||
<>
|
||||
{/* Description */}
|
||||
<div>
|
||||
<Typography variant='body2' className='mb-2'>
|
||||
Deskripsi Kampanye
|
||||
</Typography>
|
||||
<Controller
|
||||
name='description'
|
||||
control={control}
|
||||
render={({ field }) => (
|
||||
<CustomTextField
|
||||
{...field}
|
||||
fullWidth
|
||||
placeholder='Deskripsi detail tentang kampanye'
|
||||
multiline
|
||||
rows={4}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Sembunyikan */}
|
||||
<Button
|
||||
variant='text'
|
||||
color='primary'
|
||||
size='small'
|
||||
sx={{ textTransform: 'none', fontSize: '14px', p: 0, textAlign: 'left', width: '200px' }}
|
||||
onClick={() => setShowMore(false)}
|
||||
>
|
||||
- Sembunyikan
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</form>
|
||||
</Box>
|
||||
|
||||
{/* Sticky Footer */}
|
||||
<Box
|
||||
sx={{
|
||||
position: 'sticky',
|
||||
bottom: 0,
|
||||
zIndex: 10,
|
||||
backgroundColor: 'background.paper',
|
||||
borderTop: 1,
|
||||
borderColor: 'divider',
|
||||
p: 3
|
||||
}}
|
||||
>
|
||||
<div className='flex items-center gap-4'>
|
||||
<Button variant='contained' type='submit' form='campaign-form' disabled={isSubmitting}>
|
||||
{isSubmitting ? (isEditMode ? 'Mengupdate...' : 'Menyimpan...') : isEditMode ? 'Update' : 'Simpan'}
|
||||
</Button>
|
||||
<Button variant='outlined' color='error' onClick={handleReset} disabled={isSubmitting}>
|
||||
Batal
|
||||
</Button>
|
||||
</div>
|
||||
</Box>
|
||||
</Drawer>
|
||||
)
|
||||
}
|
||||
|
||||
export default AddEditCampaignDrawer
|
||||
668
src/views/apps/marketing/campaign/CampaignListTable.tsx
Normal file
668
src/views/apps/marketing/campaign/CampaignListTable.tsx
Normal file
@ -0,0 +1,668 @@
|
||||
'use client'
|
||||
|
||||
// React Imports
|
||||
import { useEffect, useState, useMemo, useCallback } from 'react'
|
||||
|
||||
// Next Imports
|
||||
import Link from 'next/link'
|
||||
import { useParams } from 'next/navigation'
|
||||
|
||||
// MUI Imports
|
||||
import Card from '@mui/material/Card'
|
||||
import CardHeader from '@mui/material/CardHeader'
|
||||
import Button from '@mui/material/Button'
|
||||
import Typography from '@mui/material/Typography'
|
||||
import Chip from '@mui/material/Chip'
|
||||
import Checkbox from '@mui/material/Checkbox'
|
||||
import IconButton from '@mui/material/IconButton'
|
||||
import { styled } from '@mui/material/styles'
|
||||
import TablePagination from '@mui/material/TablePagination'
|
||||
import type { TextFieldProps } from '@mui/material/TextField'
|
||||
import MenuItem from '@mui/material/MenuItem'
|
||||
|
||||
// Third-party Imports
|
||||
import classnames from 'classnames'
|
||||
import { rankItem } from '@tanstack/match-sorter-utils'
|
||||
import {
|
||||
createColumnHelper,
|
||||
flexRender,
|
||||
getCoreRowModel,
|
||||
useReactTable,
|
||||
getFilteredRowModel,
|
||||
getFacetedRowModel,
|
||||
getFacetedUniqueValues,
|
||||
getFacetedMinMaxValues,
|
||||
getPaginationRowModel,
|
||||
getSortedRowModel
|
||||
} from '@tanstack/react-table'
|
||||
import type { ColumnDef, FilterFn } from '@tanstack/react-table'
|
||||
import type { RankingInfo } from '@tanstack/match-sorter-utils'
|
||||
|
||||
// Type Imports
|
||||
import type { ThemeColor } from '@core/types'
|
||||
import type { Locale } from '@configs/i18n'
|
||||
|
||||
// Component Imports
|
||||
import OptionMenu from '@core/components/option-menu'
|
||||
import TablePaginationComponent from '@components/TablePaginationComponent'
|
||||
import CustomTextField from '@core/components/mui/TextField'
|
||||
import CustomAvatar from '@core/components/mui/Avatar'
|
||||
|
||||
// Util Imports
|
||||
import { getInitials } from '@/utils/getInitials'
|
||||
import { getLocalizedUrl } from '@/utils/i18n'
|
||||
import { formatCurrency } from '@/utils/transform'
|
||||
|
||||
// Style Imports
|
||||
import tableStyles from '@core/styles/table.module.css'
|
||||
import Loading from '@/components/layout/shared/Loading'
|
||||
import AddEditCampaignDrawer from './AddEditCampaignDrawer'
|
||||
|
||||
// Campaign Type Interface
|
||||
export interface Campaign {
|
||||
id: string
|
||||
name: string
|
||||
description?: string
|
||||
minimumPurchase: number
|
||||
rewardType: 'point' | 'voucher' | 'discount'
|
||||
rewardValue: number
|
||||
startDate: Date
|
||||
endDate: Date
|
||||
isActive: boolean
|
||||
createdAt: Date
|
||||
updatedAt: Date
|
||||
}
|
||||
|
||||
declare module '@tanstack/table-core' {
|
||||
interface FilterFns {
|
||||
fuzzy: FilterFn<unknown>
|
||||
}
|
||||
interface FilterMeta {
|
||||
itemRank: RankingInfo
|
||||
}
|
||||
}
|
||||
|
||||
type CampaignWithAction = Campaign & {
|
||||
action?: string
|
||||
}
|
||||
|
||||
// Styled Components
|
||||
const Icon = styled('i')({})
|
||||
|
||||
const fuzzyFilter: FilterFn<any> = (row, columnId, value, addMeta) => {
|
||||
// Rank the item
|
||||
const itemRank = rankItem(row.getValue(columnId), value)
|
||||
|
||||
// Store the itemRank info
|
||||
addMeta({
|
||||
itemRank
|
||||
})
|
||||
|
||||
// Return if the item should be filtered in/out
|
||||
return itemRank.passed
|
||||
}
|
||||
|
||||
const DebouncedInput = ({
|
||||
value: initialValue,
|
||||
onChange,
|
||||
debounce = 500,
|
||||
...props
|
||||
}: {
|
||||
value: string | number
|
||||
onChange: (value: string | number) => void
|
||||
debounce?: number
|
||||
} & Omit<TextFieldProps, 'onChange'>) => {
|
||||
// States
|
||||
const [value, setValue] = useState(initialValue)
|
||||
|
||||
useEffect(() => {
|
||||
setValue(initialValue)
|
||||
}, [initialValue])
|
||||
|
||||
useEffect(() => {
|
||||
const timeout = setTimeout(() => {
|
||||
onChange(value)
|
||||
}, debounce)
|
||||
|
||||
return () => clearTimeout(timeout)
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [value])
|
||||
|
||||
return <CustomTextField {...props} value={value} onChange={e => setValue(e.target.value)} />
|
||||
}
|
||||
|
||||
// Dummy data for campaigns
|
||||
const DUMMY_CAMPAIGN_DATA: Campaign[] = [
|
||||
{
|
||||
id: '1',
|
||||
name: 'Summer Sale Campaign',
|
||||
description: 'Get extra points during summer season',
|
||||
minimumPurchase: 500000,
|
||||
rewardType: 'point',
|
||||
rewardValue: 100,
|
||||
startDate: new Date('2024-06-01'),
|
||||
endDate: new Date('2024-08-31'),
|
||||
isActive: true,
|
||||
createdAt: new Date('2024-05-15'),
|
||||
updatedAt: new Date('2024-06-01')
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
name: 'Welcome Bonus',
|
||||
description: 'Special discount for new customers',
|
||||
minimumPurchase: 200000,
|
||||
rewardType: 'discount',
|
||||
rewardValue: 15,
|
||||
startDate: new Date('2024-01-01'),
|
||||
endDate: new Date('2024-12-31'),
|
||||
isActive: true,
|
||||
createdAt: new Date('2024-01-01'),
|
||||
updatedAt: new Date('2024-03-15')
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
name: 'Flash Sale Weekend',
|
||||
description: 'Weekend special voucher campaign',
|
||||
minimumPurchase: 1000000,
|
||||
rewardType: 'voucher',
|
||||
rewardValue: 50000,
|
||||
startDate: new Date('2024-07-06'),
|
||||
endDate: new Date('2024-07-07'),
|
||||
isActive: false,
|
||||
createdAt: new Date('2024-07-01'),
|
||||
updatedAt: new Date('2024-07-08')
|
||||
},
|
||||
{
|
||||
id: '4',
|
||||
name: 'Loyalty Rewards',
|
||||
description: 'Extra points for loyal customers',
|
||||
minimumPurchase: 2000000,
|
||||
rewardType: 'point',
|
||||
rewardValue: 300,
|
||||
startDate: new Date('2024-03-01'),
|
||||
endDate: new Date('2024-09-30'),
|
||||
isActive: true,
|
||||
createdAt: new Date('2024-02-25'),
|
||||
updatedAt: new Date('2024-05-10')
|
||||
},
|
||||
{
|
||||
id: '5',
|
||||
name: 'Black Friday Special',
|
||||
description: 'Biggest discount of the year',
|
||||
minimumPurchase: 800000,
|
||||
rewardType: 'discount',
|
||||
rewardValue: 25,
|
||||
startDate: new Date('2024-11-29'),
|
||||
endDate: new Date('2024-11-29'),
|
||||
isActive: false,
|
||||
createdAt: new Date('2024-11-01'),
|
||||
updatedAt: new Date('2024-11-30')
|
||||
},
|
||||
{
|
||||
id: '6',
|
||||
name: 'Student Promo',
|
||||
description: 'Special voucher for students',
|
||||
minimumPurchase: 300000,
|
||||
rewardType: 'voucher',
|
||||
rewardValue: 25000,
|
||||
startDate: new Date('2024-09-01'),
|
||||
endDate: new Date('2024-12-20'),
|
||||
isActive: true,
|
||||
createdAt: new Date('2024-08-25'),
|
||||
updatedAt: new Date('2024-09-01')
|
||||
},
|
||||
{
|
||||
id: '7',
|
||||
name: 'Holiday Celebration',
|
||||
description: 'Special points during holidays',
|
||||
minimumPurchase: 1500000,
|
||||
rewardType: 'point',
|
||||
rewardValue: 200,
|
||||
startDate: new Date('2024-12-15'),
|
||||
endDate: new Date('2025-01-15'),
|
||||
isActive: true,
|
||||
createdAt: new Date('2024-12-01'),
|
||||
updatedAt: new Date('2024-12-15')
|
||||
},
|
||||
{
|
||||
id: '8',
|
||||
name: 'Mid Year Sale',
|
||||
description: 'Mid year discount campaign',
|
||||
minimumPurchase: 600000,
|
||||
rewardType: 'discount',
|
||||
rewardValue: 20,
|
||||
startDate: new Date('2024-06-15'),
|
||||
endDate: new Date('2024-07-15'),
|
||||
isActive: false,
|
||||
createdAt: new Date('2024-06-01'),
|
||||
updatedAt: new Date('2024-07-16')
|
||||
}
|
||||
]
|
||||
|
||||
// Mock data hook with dummy data
|
||||
const useCampaigns = ({ page, limit, search }: { page: number; limit: number; search: string }) => {
|
||||
const [isLoading, setIsLoading] = useState(false)
|
||||
|
||||
// Simulate loading
|
||||
useEffect(() => {
|
||||
setIsLoading(true)
|
||||
const timer = setTimeout(() => setIsLoading(false), 500)
|
||||
return () => clearTimeout(timer)
|
||||
}, [page, limit, search])
|
||||
|
||||
// Filter data based on search
|
||||
const filteredData = useMemo(() => {
|
||||
if (!search) return DUMMY_CAMPAIGN_DATA
|
||||
|
||||
return DUMMY_CAMPAIGN_DATA.filter(
|
||||
campaign =>
|
||||
campaign.name.toLowerCase().includes(search.toLowerCase()) ||
|
||||
campaign.description?.toLowerCase().includes(search.toLowerCase()) ||
|
||||
campaign.rewardType.toLowerCase().includes(search.toLowerCase())
|
||||
)
|
||||
}, [search])
|
||||
|
||||
// Paginate data
|
||||
const paginatedData = useMemo(() => {
|
||||
const startIndex = (page - 1) * limit
|
||||
const endIndex = startIndex + limit
|
||||
return filteredData.slice(startIndex, endIndex)
|
||||
}, [filteredData, page, limit])
|
||||
|
||||
return {
|
||||
data: {
|
||||
campaigns: paginatedData,
|
||||
total_count: filteredData.length
|
||||
},
|
||||
isLoading,
|
||||
error: null,
|
||||
isFetching: isLoading
|
||||
}
|
||||
}
|
||||
|
||||
// Utility functions
|
||||
const getRewardTypeColor = (rewardType: Campaign['rewardType']): ThemeColor => {
|
||||
switch (rewardType) {
|
||||
case 'point':
|
||||
return 'primary'
|
||||
case 'voucher':
|
||||
return 'success'
|
||||
case 'discount':
|
||||
return 'warning'
|
||||
default:
|
||||
return 'info'
|
||||
}
|
||||
}
|
||||
|
||||
const getRewardTypeIcon = (rewardType: Campaign['rewardType']): string => {
|
||||
switch (rewardType) {
|
||||
case 'point':
|
||||
return 'tabler-coins'
|
||||
case 'voucher':
|
||||
return 'tabler-ticket'
|
||||
case 'discount':
|
||||
return 'tabler-percentage'
|
||||
default:
|
||||
return 'tabler-gift'
|
||||
}
|
||||
}
|
||||
|
||||
const formatRewardValue = (rewardType: Campaign['rewardType'], rewardValue: number): string => {
|
||||
switch (rewardType) {
|
||||
case 'point':
|
||||
return `${rewardValue} Poin`
|
||||
case 'voucher':
|
||||
return formatCurrency(rewardValue)
|
||||
case 'discount':
|
||||
return `${rewardValue}%`
|
||||
default:
|
||||
return rewardValue.toString()
|
||||
}
|
||||
}
|
||||
|
||||
// Column Definitions
|
||||
const columnHelper = createColumnHelper<CampaignWithAction>()
|
||||
|
||||
const CampaignListTable = () => {
|
||||
// States
|
||||
const [addCampaignOpen, setAddCampaignOpen] = useState(false)
|
||||
const [editCampaignData, setEditCampaignData] = useState<Campaign | undefined>(undefined)
|
||||
const [rowSelection, setRowSelection] = useState({})
|
||||
const [globalFilter, setGlobalFilter] = useState('')
|
||||
const [currentPage, setCurrentPage] = useState(1)
|
||||
const [pageSize, setPageSize] = useState(10)
|
||||
const [search, setSearch] = useState('')
|
||||
|
||||
const { data, isLoading, error, isFetching } = useCampaigns({
|
||||
page: currentPage,
|
||||
limit: pageSize,
|
||||
search
|
||||
})
|
||||
|
||||
const campaigns = data?.campaigns ?? []
|
||||
const totalCount = data?.total_count ?? 0
|
||||
|
||||
// Hooks
|
||||
const { lang: locale } = useParams()
|
||||
|
||||
const handlePageChange = useCallback((event: unknown, newPage: number) => {
|
||||
setCurrentPage(newPage)
|
||||
}, [])
|
||||
|
||||
const handlePageSizeChange = useCallback((event: React.ChangeEvent<HTMLInputElement>) => {
|
||||
const newPageSize = parseInt(event.target.value, 10)
|
||||
setPageSize(newPageSize)
|
||||
setCurrentPage(1) // Reset to first page
|
||||
}, [])
|
||||
|
||||
const handleEditCampaign = (campaign: Campaign) => {
|
||||
setEditCampaignData(campaign)
|
||||
setAddCampaignOpen(true)
|
||||
}
|
||||
|
||||
const handleDeleteCampaign = (campaignId: string) => {
|
||||
if (confirm('Apakah Anda yakin ingin menghapus kampanye ini?')) {
|
||||
console.log('Deleting campaign:', campaignId)
|
||||
// Add your delete logic here
|
||||
// deleteCampaign.mutate(campaignId)
|
||||
}
|
||||
}
|
||||
|
||||
const handleCloseCampaignDrawer = () => {
|
||||
setAddCampaignOpen(false)
|
||||
setEditCampaignData(undefined)
|
||||
}
|
||||
|
||||
const columns = useMemo<ColumnDef<CampaignWithAction, any>[]>(
|
||||
() => [
|
||||
{
|
||||
id: 'select',
|
||||
header: ({ table }) => (
|
||||
<Checkbox
|
||||
{...{
|
||||
checked: table.getIsAllRowsSelected(),
|
||||
indeterminate: table.getIsSomeRowsSelected(),
|
||||
onChange: table.getToggleAllRowsSelectedHandler()
|
||||
}}
|
||||
/>
|
||||
),
|
||||
cell: ({ row }) => (
|
||||
<Checkbox
|
||||
{...{
|
||||
checked: row.getIsSelected(),
|
||||
disabled: !row.getCanSelect(),
|
||||
indeterminate: row.getIsSomeSelected(),
|
||||
onChange: row.getToggleSelectedHandler()
|
||||
}}
|
||||
/>
|
||||
)
|
||||
},
|
||||
columnHelper.accessor('name', {
|
||||
header: 'Nama Kampanye',
|
||||
cell: ({ row }) => (
|
||||
<div className='flex items-center gap-4'>
|
||||
<div className='flex flex-col'>
|
||||
<Link href={getLocalizedUrl(`/apps/campaigns/${row.original.id}/detail`, locale as Locale)}>
|
||||
<Typography className='font-medium cursor-pointer hover:underline text-primary'>
|
||||
{row.original.name}
|
||||
</Typography>
|
||||
</Link>
|
||||
{row.original.description && (
|
||||
<Typography variant='body2' color='text.secondary' className='max-w-xs truncate'>
|
||||
{row.original.description}
|
||||
</Typography>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}),
|
||||
columnHelper.accessor('minimumPurchase', {
|
||||
header: 'Minimum Pembelian',
|
||||
cell: ({ row }) => (
|
||||
<div className='flex items-center gap-2'>
|
||||
<Icon className='tabler-coin' sx={{ color: 'var(--mui-palette-primary-main)' }} />
|
||||
<Typography color='text.primary'>{formatCurrency(row.original.minimumPurchase)}</Typography>
|
||||
</div>
|
||||
)
|
||||
}),
|
||||
columnHelper.accessor('rewardType', {
|
||||
header: 'Jenis Reward',
|
||||
cell: ({ row }) => (
|
||||
<div className='flex items-center gap-2'>
|
||||
<Icon
|
||||
className={getRewardTypeIcon(row.original.rewardType)}
|
||||
sx={{ color: `var(--mui-palette-${getRewardTypeColor(row.original.rewardType)}-main)` }}
|
||||
/>
|
||||
<Chip
|
||||
label={formatRewardValue(row.original.rewardType, row.original.rewardValue)}
|
||||
color={getRewardTypeColor(row.original.rewardType)}
|
||||
variant='tonal'
|
||||
size='small'
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}),
|
||||
columnHelper.accessor('startDate', {
|
||||
header: 'Periode Kampanye',
|
||||
cell: ({ row }) => (
|
||||
<div className='flex flex-col'>
|
||||
<Typography variant='body2' color='text.primary'>
|
||||
{new Date(row.original.startDate).toLocaleDateString('id-ID', {
|
||||
year: 'numeric',
|
||||
month: 'short',
|
||||
day: 'numeric'
|
||||
})}
|
||||
</Typography>
|
||||
<Typography variant='body2' color='text.secondary'>
|
||||
s/d{' '}
|
||||
{new Date(row.original.endDate).toLocaleDateString('id-ID', {
|
||||
year: 'numeric',
|
||||
month: 'short',
|
||||
day: 'numeric'
|
||||
})}
|
||||
</Typography>
|
||||
</div>
|
||||
)
|
||||
}),
|
||||
columnHelper.accessor('isActive', {
|
||||
header: 'Status',
|
||||
cell: ({ row }) => (
|
||||
<Chip
|
||||
label={row.original.isActive ? 'Aktif' : 'Tidak Aktif'}
|
||||
color={row.original.isActive ? 'success' : 'error'}
|
||||
variant='tonal'
|
||||
size='small'
|
||||
/>
|
||||
)
|
||||
}),
|
||||
columnHelper.accessor('createdAt', {
|
||||
header: 'Tanggal Dibuat',
|
||||
cell: ({ row }) => (
|
||||
<Typography color='text.primary'>
|
||||
{new Date(row.original.createdAt).toLocaleDateString('id-ID', {
|
||||
year: 'numeric',
|
||||
month: 'short',
|
||||
day: 'numeric'
|
||||
})}
|
||||
</Typography>
|
||||
)
|
||||
}),
|
||||
{
|
||||
id: 'actions',
|
||||
header: 'Aksi',
|
||||
cell: ({ row }) => (
|
||||
<div className='flex items-center'>
|
||||
<OptionMenu
|
||||
iconButtonProps={{ size: 'medium' }}
|
||||
iconClassName='text-textSecondary text-[22px]'
|
||||
options={[
|
||||
{
|
||||
text: 'Edit',
|
||||
icon: 'tabler-edit text-[22px]',
|
||||
menuItemProps: {
|
||||
className: 'flex items-center gap-2 text-textSecondary',
|
||||
onClick: () => handleEditCampaign(row.original)
|
||||
}
|
||||
},
|
||||
{
|
||||
text: 'Hapus',
|
||||
icon: 'tabler-trash text-[22px]',
|
||||
menuItemProps: {
|
||||
className: 'flex items-center gap-2 text-textSecondary',
|
||||
onClick: () => handleDeleteCampaign(row.original.id)
|
||||
}
|
||||
}
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
),
|
||||
enableSorting: false
|
||||
}
|
||||
],
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
[locale, handleEditCampaign, handleDeleteCampaign]
|
||||
)
|
||||
|
||||
const table = useReactTable({
|
||||
data: campaigns as Campaign[],
|
||||
columns,
|
||||
filterFns: {
|
||||
fuzzy: fuzzyFilter
|
||||
},
|
||||
state: {
|
||||
rowSelection,
|
||||
globalFilter,
|
||||
pagination: {
|
||||
pageIndex: currentPage,
|
||||
pageSize
|
||||
}
|
||||
},
|
||||
enableRowSelection: true,
|
||||
onRowSelectionChange: setRowSelection,
|
||||
getCoreRowModel: getCoreRowModel(),
|
||||
manualPagination: true,
|
||||
pageCount: Math.ceil(totalCount / pageSize)
|
||||
})
|
||||
|
||||
return (
|
||||
<>
|
||||
<Card>
|
||||
<div className='flex justify-between flex-col items-start md:flex-row md:items-center p-6 border-bs gap-4'>
|
||||
<CustomTextField
|
||||
select
|
||||
value={table.getState().pagination.pageSize}
|
||||
onChange={e => table.setPageSize(Number(e.target.value))}
|
||||
className='max-sm:is-full sm:is-[70px]'
|
||||
>
|
||||
<MenuItem value='10'>10</MenuItem>
|
||||
<MenuItem value='25'>25</MenuItem>
|
||||
<MenuItem value='50'>50</MenuItem>
|
||||
</CustomTextField>
|
||||
<div className='flex flex-col sm:flex-row max-sm:is-full items-start sm:items-center gap-4'>
|
||||
<DebouncedInput
|
||||
value={search ?? ''}
|
||||
onChange={value => setSearch(value as string)}
|
||||
placeholder='Cari Kampanye'
|
||||
className='max-sm:is-full'
|
||||
/>
|
||||
<Button
|
||||
color='secondary'
|
||||
variant='tonal'
|
||||
startIcon={<i className='tabler-upload' />}
|
||||
className='max-sm:is-full'
|
||||
>
|
||||
Ekspor
|
||||
</Button>
|
||||
<Button
|
||||
variant='contained'
|
||||
startIcon={<i className='tabler-plus' />}
|
||||
onClick={() => setAddCampaignOpen(!addCampaignOpen)}
|
||||
className='max-sm:is-full'
|
||||
>
|
||||
Tambah Kampanye
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<div className='overflow-x-auto'>
|
||||
{isLoading ? (
|
||||
<Loading />
|
||||
) : (
|
||||
<table className={tableStyles.table}>
|
||||
<thead>
|
||||
{table.getHeaderGroups().map(headerGroup => (
|
||||
<tr key={headerGroup.id}>
|
||||
{headerGroup.headers.map(header => (
|
||||
<th key={header.id}>
|
||||
{header.isPlaceholder ? null : (
|
||||
<>
|
||||
<div
|
||||
className={classnames({
|
||||
'flex items-center': header.column.getIsSorted(),
|
||||
'cursor-pointer select-none': header.column.getCanSort()
|
||||
})}
|
||||
onClick={header.column.getToggleSortingHandler()}
|
||||
>
|
||||
{flexRender(header.column.columnDef.header, header.getContext())}
|
||||
{{
|
||||
asc: <i className='tabler-chevron-up text-xl' />,
|
||||
desc: <i className='tabler-chevron-down text-xl' />
|
||||
}[header.column.getIsSorted() as 'asc' | 'desc'] ?? null}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</th>
|
||||
))}
|
||||
</tr>
|
||||
))}
|
||||
</thead>
|
||||
{table.getFilteredRowModel().rows.length === 0 ? (
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colSpan={table.getVisibleFlatColumns().length} className='text-center'>
|
||||
Tidak ada data tersedia
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
) : (
|
||||
<tbody>
|
||||
{table
|
||||
.getRowModel()
|
||||
.rows.slice(0, table.getState().pagination.pageSize)
|
||||
.map(row => {
|
||||
return (
|
||||
<tr key={row.id} className={classnames({ selected: row.getIsSelected() })}>
|
||||
{row.getVisibleCells().map(cell => (
|
||||
<td key={cell.id}>{flexRender(cell.column.columnDef.cell, cell.getContext())}</td>
|
||||
))}
|
||||
</tr>
|
||||
)
|
||||
})}
|
||||
</tbody>
|
||||
)}
|
||||
</table>
|
||||
)}
|
||||
</div>
|
||||
<TablePagination
|
||||
component={() => (
|
||||
<TablePaginationComponent
|
||||
pageIndex={currentPage}
|
||||
pageSize={pageSize}
|
||||
totalCount={totalCount}
|
||||
onPageChange={handlePageChange}
|
||||
/>
|
||||
)}
|
||||
count={totalCount}
|
||||
rowsPerPage={pageSize}
|
||||
page={currentPage}
|
||||
onPageChange={handlePageChange}
|
||||
onRowsPerPageChange={handlePageSizeChange}
|
||||
rowsPerPageOptions={[10, 25, 50]}
|
||||
disabled={isLoading}
|
||||
/>
|
||||
</Card>
|
||||
<AddEditCampaignDrawer open={addCampaignOpen} handleClose={handleCloseCampaignDrawer} data={editCampaignData} />
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default CampaignListTable
|
||||
17
src/views/apps/marketing/campaign/index.tsx
Normal file
17
src/views/apps/marketing/campaign/index.tsx
Normal file
@ -0,0 +1,17 @@
|
||||
// MUI Imports
|
||||
import Grid from '@mui/material/Grid2'
|
||||
import LoyaltyListTable from './CampaignListTable'
|
||||
|
||||
// Type Imports
|
||||
|
||||
const LoyaltyList = () => {
|
||||
return (
|
||||
<Grid container spacing={6}>
|
||||
<Grid size={{ xs: 12 }}>
|
||||
<LoyaltyListTable />
|
||||
</Grid>
|
||||
</Grid>
|
||||
)
|
||||
}
|
||||
|
||||
export default LoyaltyList
|
||||
Loading…
x
Reference in New Issue
Block a user