- Adjusted the calculation of payable amounts in PaymentStep to align with server logic, ensuring overpayments are handled correctly. - Enhanced DetailsStep to include consumables in the itemized cost breakdown, ensuring consistency with patient share calculations. - Updated tests for SessionPaymentPage to validate new behavior regarding overpayments and consumable listings. - Modified PatientController to register SessionPayment correctly when settling sessions via wallet, preventing double charges. - Refactored WalletService to remove outdated methods and ensure wallet transactions reflect the correct amounts after discounts. - Improved accessibility in SearchableSelect component by adding aria labels and ensuring proper role attributes for screen readers. - Updated styles to ensure minimum touch targets meet WCAG guidelines for mobile usability.
53 lines
1.8 KiB
TypeScript
53 lines
1.8 KiB
TypeScript
/**
|
|
* تب دکترها با نشانگر underline — بازسازی تبهای بالای صفحهٔ نوبتهای طرح tauri
|
|
* (`index.jsx`): فعال #5559ce با خط زیرین، بقیه خاکستری.
|
|
*/
|
|
export interface DoctorTab {
|
|
uuid: string;
|
|
name: string;
|
|
}
|
|
|
|
export default function DoctorTabs({
|
|
doctors, selected, onSelect, showAll = true,
|
|
}: {
|
|
doctors: DoctorTab[];
|
|
/** '' یعنی «همه». */
|
|
selected: string;
|
|
onSelect: (uuid: string) => void;
|
|
showAll?: boolean;
|
|
}) {
|
|
const tabs: DoctorTab[] = showAll ? [{ uuid: '', name: 'همه' }, ...doctors] : doctors;
|
|
return (
|
|
<div style={{
|
|
display: 'flex', alignItems: 'center', gap: 24, padding: '8px 16px 0',
|
|
borderBottom: '1px solid var(--border)', overflowX: 'auto',
|
|
}}>
|
|
{tabs.map((d) => {
|
|
const active = selected === d.uuid;
|
|
return (
|
|
<button
|
|
key={d.uuid || 'all'}
|
|
type="button"
|
|
onClick={() => onSelect(d.uuid)}
|
|
style={{
|
|
position: 'relative', background: 'none', border: 'none', cursor: 'pointer',
|
|
fontFamily: 'inherit', fontSize: 15, fontWeight: 500, padding: '8px 2px 12px',
|
|
color: active ? 'var(--primary)' : 'var(--text-2)', whiteSpace: 'nowrap',
|
|
// برچسبهای کوتاه («همه») بدون این، عرضشان زیر ۴۴px میماند (WCAG 2.5.5)
|
|
minWidth: 44,
|
|
}}
|
|
>
|
|
{d.name}
|
|
{active && (
|
|
<span style={{
|
|
position: 'absolute', bottom: -1, left: 0, right: 0, height: 3,
|
|
background: 'var(--primary)', borderRadius: '3px 3px 0 0',
|
|
}} />
|
|
)}
|
|
</button>
|
|
);
|
|
})}
|
|
</div>
|
|
);
|
|
}
|