In the resource-first model a resource is the unit of capacity, so its
working hours, holidays, services, skills and categories belong to it — not
scattered across a list page's modals plus a separate calendar page.
/admin/resources/{uuid} now carries six tabs and the active tab lives in the
query string, so back and refresh land on the same view. The old
/calendar URL redirects to ?tab=hours instead of 404ing.
The skills and services modal bodies became panels the tab renders directly;
the modals are now thin wrappers, so the list page keeps working unchanged
and there is still one implementation of each editor.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
28 lines
855 B
TypeScript
28 lines
855 B
TypeScript
import React from 'react';
|
|
import Modal from '../ui/Modal';
|
|
import ResourceSkillsPanel, { type SkillLine } from './ResourceSkillsPanel';
|
|
import type { ClinicResource, Skill } from '../../types';
|
|
|
|
interface Props {
|
|
resource: ClinicResource | null;
|
|
skills: Skill[];
|
|
saving: boolean;
|
|
onClose: () => void;
|
|
onSave: (lines: SkillLine[]) => void;
|
|
}
|
|
|
|
/** همان پنل مهارتها، در قاب مودالِ فهرست منابع. */
|
|
export default function ResourceSkillsModal({ resource, skills, saving, onClose, onSave }: Props) {
|
|
return (
|
|
<Modal open={resource !== null} onClose={onClose} title={`مهارتهای ${resource?.name ?? 'منبع'}`}>
|
|
<ResourceSkillsPanel
|
|
resource={resource}
|
|
skills={skills}
|
|
saving={saving}
|
|
onCancel={onClose}
|
|
onSave={onSave}
|
|
/>
|
|
</Modal>
|
|
);
|
|
}
|