Positioning, sizing and sorting of the gadgets improved.

This commit is contained in:
2026-07-11 22:32:37 +03:30
parent ed8ff61205
commit 83f6003a2b
35 changed files with 1615 additions and 678 deletions

View File

@@ -11,8 +11,8 @@ import {
} from 'lucide-react';
import type { Organization } from '@/types/organization';
import {
canAccessAppointmentsSection,
canEditStaff,
canViewAppointmentsTab,
canViewCases,
canViewStaff,
canViewTasks,
@@ -67,7 +67,7 @@ export const TODAY_KPI_DEFINITIONS: TodayKpiDefinition[] = [
color: 'blue',
orgTypes: ['CLINIC'],
href: '/appointments',
isVisible: (org) => canAccessAppointmentsSection(org),
isVisible: (org) => canViewAppointmentsTab(org),
formatValue: (widgets) => {
const count = countWidget(widgets, 'appointmentsToday');
return count === null ? null : String(count);
@@ -80,7 +80,7 @@ export const TODAY_KPI_DEFINITIONS: TodayKpiDefinition[] = [
color: 'green',
orgTypes: ['CLINIC'],
href: '/patients',
isVisible: (org) => canViewPatients(org) || canAccessAppointmentsSection(org),
isVisible: (org) => canViewPatients(org) || canViewAppointmentsTab(org),
formatValue: (widgets) => {
const count = countWidget(widgets, 'patientsToday');
return count === null ? null : String(count);
@@ -203,26 +203,6 @@ export const TODAY_KPI_DEFINITIONS: TodayKpiDefinition[] = [
return count === null ? null : String(count);
},
},
{
key: 'seats',
titleKey: 'widgetSeats',
icon: UserCog,
color: 'default',
orgTypes: ['CLINIC', 'LAB'],
href: '/staff',
isVisible: (org) => canViewStaff(org),
formatValue: (widgets) => {
const seats = widgets.seats;
if (!seats || !('used' in seats)) return null;
if (seats.unlimited) return String(seats.used);
return `${seats.used}/${seats.limit ?? 0}`;
},
formatSubtitle: (widgets) => {
const seats = widgets.seats;
if (!seats || !('used' in seats)) return null;
return seats.unlimited ? 'unlimited' : null;
},
},
{
key: 'pendingStaffInvites',
titleKey: 'widgetPendingStaffInvites',