feat(patients): standalone new-session page with sectioned UX

Dedicated route /admin/my-patients/:recordUuid/session/new replacing the
modal: insurance & price section (auto-fill from pricing), services,
payment/notes, sticky live summary. New-visit buttons navigate to it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
hamed
2026-06-23 20:41:22 +03:30
co-authored by Claude Opus 4.8
parent 017ea2ae22
commit 18ae55ac30
3 changed files with 258 additions and 14 deletions
+4 -14
View File
@@ -15,6 +15,7 @@ import { zodResolver } from "@hookform/resolvers/zod";
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import React, { useCallback, useRef, useState } from "react";
import { useForm } from "react-hook-form";
import { useNavigate } from "react-router-dom";
import { toast } from "sonner";
import { z } from "zod";
import FeatureGate from "../components/ui/FeatureGate";
@@ -103,6 +104,7 @@ function calcFinalPrice(
function MyPatientsPageInner() {
const qc = useQueryClient();
const navigate = useNavigate();
const [selectedRecord, setSelectedRecord] = useState<PatientRecord | null>(
null,
);
@@ -828,13 +830,7 @@ function MyPatientsPageInner() {
</button>
<button
className="btn primary sm"
onClick={() => {
form.reset();
setSelectedServices([]);
setBaseInsuranceId("");
setSuppInsuranceId("");
setSessionModal(true);
}}
onClick={() => navigate(`/admin/my-patients/${selectedRecord.uuid}/session/new`)}
>
<PlusIcon style={{ width: 15 }} /> مراجعه جدید
</button>
@@ -1005,13 +1001,7 @@ function MyPatientsPageInner() {
<button
className="btn primary sm"
style={{ marginTop: 12 }}
onClick={() => {
form.reset();
setSelectedServices([]);
setBaseInsuranceId("");
setSuppInsuranceId("");
setSessionModal(true);
}}
onClick={() => navigate(`/admin/my-patients/${selectedRecord.uuid}/session/new`)}
>
<PlusIcon style={{ width: 14 }} /> ثبت اولین مراجعه
</button>