feature: a minimal implementation of the appointment feature done.
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
import type { AppointmentPurpose } from '@/types/appointment';
|
||||
|
||||
export const APPOINTMENT_PURPOSE_LABEL: Record<AppointmentPurpose, string> = {
|
||||
consultation: 'Consultation',
|
||||
filling: 'Filling',
|
||||
endo: 'Endo',
|
||||
visit: 'Visit',
|
||||
hygiene: 'Hygiene',
|
||||
};
|
||||
|
||||
/** Background + border for blocks / legend (matches reference palette). */
|
||||
export const APPOINTMENT_PURPOSE_STYLES: Record<AppointmentPurpose, string> = {
|
||||
consultation: 'bg-violet-500/25 border-violet-400/50 text-violet-100',
|
||||
filling: 'bg-orange-500/25 border-orange-400/50 text-orange-100',
|
||||
endo: 'bg-red-500/25 border-red-400/50 text-red-100',
|
||||
visit: 'bg-sky-500/25 border-sky-400/50 text-sky-100',
|
||||
hygiene: 'bg-lime-500/20 border-lime-400/45 text-lime-100',
|
||||
};
|
||||
|
||||
export function purposeStyle(purpose: string): string {
|
||||
const p = purpose as AppointmentPurpose;
|
||||
return APPOINTMENT_PURPOSE_STYLES[p] ?? 'bg-surface-elevated border-border text-text-secondary';
|
||||
}
|
||||
|
||||
/** Trash icon only — same hues as legend swatches (icon stroke via currentColor). */
|
||||
export function purposeDeleteIconClass(purpose: string): string {
|
||||
const p = purpose as AppointmentPurpose;
|
||||
const map: Record<AppointmentPurpose, string> = {
|
||||
consultation: 'text-violet-400 hover:text-violet-300',
|
||||
filling: 'text-orange-400 hover:text-orange-300',
|
||||
endo: 'text-red-400 hover:text-red-300',
|
||||
visit: 'text-sky-400 hover:text-sky-300',
|
||||
hygiene: 'text-lime-700 hover:text-lime-600',
|
||||
};
|
||||
return map[p] ?? 'text-text-muted hover:text-text-secondary';
|
||||
}
|
||||
|
||||
/** Small swatch for legend (background + border only). */
|
||||
export const APPOINTMENT_PURPOSE_LEGEND_SWATCH: Record<AppointmentPurpose, string> = {
|
||||
consultation: 'bg-violet-500/85 border-violet-400/75',
|
||||
filling: 'bg-orange-500/85 border-orange-400/75',
|
||||
endo: 'bg-red-500/85 border-red-400/75',
|
||||
visit: 'bg-sky-500/85 border-sky-400/75',
|
||||
hygiene: 'bg-lime-500/80 border-lime-400/70',
|
||||
};
|
||||
Reference in New Issue
Block a user