import { useTranslations } from 'next-intl';
import { useAppSelector } from '@/redux/store';
export default function GeneralLook()
{
const t = useTranslations('statistics');
const report = useAppSelector((state) => state.statisticsReducer.value.report)
if (!report) {
return (
);
}
const stats = [
{
icon: 'members',
value: report?.membersCount?.value ?? 0,
label: t('totalMembers'),
bgColor: 'bg-info'
},
{
icon: 'activeMembers',
value: report?.activeMembersCount?.value ?? 0,
label: t('totalActiveMembers'),
bgColor: 'bg-success'
},
{
icon: 'disActiveMembers',
value: report?.disActiveMembersCount?.value ?? 0,
label: t('totalUnActiveMembers'),
bgColor: 'bg-error'
},
{
icon: 'services',
value: report?.servicesCount?.value ?? 0,
label: t('totalServices'),
bgColor: 'bg-info'
},
{
icon: 'activeServices',
value: report?.activeServicesCount?.value ?? 0,
label: t('totalActiveServices'),
bgColor: 'bg-success'
},
{
icon: 'disActiveServices',
value: report?.disActiveServicesCount?.value ?? 0,
label: t('totalUnActiveServices'),
bgColor: 'bg-error'
},
{
icon: 'activeSubscriptions',
value: report?.activeSubscriptionsCount?.value ?? 0,
label: t('totalActiveSubscriptions'),
bgColor: 'bg-info'
},
{
icon: 'expiredSoonSubscriptions',
value: report?.expiredSoonSubscriptionsCount?.value ?? 0,
label: t('expiredSoonSubscriptionsCount'),
bgColor: 'bg-warning'
},
{
icon: 'expiredSubscriptions',
value: report?.expiredSubscriptionsCount?.value ?? 0,
label: t('totalExpiredSubscriptions'),
bgColor: 'bg-error'
}
];
return (
{stats.map((stat, index) => (
{stat.value}
{stat.label}
))}
)
}