feature: phase0 - Global patients + mobile normalization

This commit is contained in:
2026-06-28 14:49:37 +03:30
parent 653d67e15b
commit 64c7e5a257
23 changed files with 535 additions and 260 deletions

View File

@@ -20,6 +20,7 @@ import {
} from '@/components/appointments/appointmentOverlapLayout';
import { purposeStyle } from '@/components/ui/appointments/appointmentPurposeStyles';
import { AppointmentOverlapPopover } from '@/components/ui/appointments/AppointmentOverlapPopover';
import { formatMobileForDisplay } from '@/lib/phone';
import { startOfLocalDay } from '@/components/appointments/appointmentTime';
const HOUR_PX = 80;
@@ -300,7 +301,9 @@ export function AppointmentScheduleGrid({
clusterSize > 1
? t('overlappingChoose', { count: clusterSize })
: null,
!isUnderOneHour && apt.patient.phone ? apt.patient.phone : null,
!isUnderOneHour && apt.patient.mobile
? formatMobileForDisplay(apt.patient.mobile)
: null,
]
.filter(Boolean)
.join(' · ');
@@ -338,10 +341,10 @@ export function AppointmentScheduleGrid({
{patientName}
</span>
{!isUnderOneHour &&
apt.patient.phone &&
apt.patient.mobile &&
lane.laneCount === 1 && (
<span className="block w-full truncate pointer-events-none text-[10px] leading-tight opacity-90">
{apt.patient.phone}
{formatMobileForDisplay(apt.patient.mobile)}
</span>
)}
{!isUnderOneHour && clusterSize > 1 && (

View File

@@ -4,6 +4,7 @@ import { Search } from 'lucide-react';
import { useTranslations } from 'next-intl';
import { Button } from '@/components/ui/shared/Button';
import { Input } from '@/components/ui/shared/Input';
import { formatMobileForDisplay } from '@/lib/phone';
import type { Patient } from '@/types/patient';
interface AppointmentsPatientSearchProps {
@@ -82,7 +83,7 @@ export function AppointmentsPatientSearch({
{patient.firstName} {patient.lastName}
</p>
<p className="text-xs text-text-muted">
{patient.phone || patient.email || tPatients('noContact')}
{formatMobileForDisplay(patient.mobile) || patient.email || tPatients('noContact')}
</p>
</button>
);