Skip to content

Commit 409caad

Browse files
committed
fix: แก้ bug form แก้คำ
1 parent 27c4653 commit 409caad

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

client/my-app/src/app/components/Cameras/CameraTable.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,8 @@ export default function CameraTable({
371371
<Eye className="h-4 w-4" />
372372
</IconAction>
373373

374-
{/* Edit (เปิด modal เดิม) */}
375-
<IconAction label="Edit" variant="primary" onClick={goEdit}>
374+
{/* Setting (เปิด modal เดิม) */}
375+
<IconAction label="Settings" variant="primary" onClick={goEdit}>
376376
<Pencil className="h-4 w-4" />
377377
</IconAction>
378378

client/my-app/src/app/components/Forms/CreateCameraForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ export default function
326326
Location
327327
</Label>
328328

329-
<Select name="location_id" defaultValue="">
329+
<Select name="location_id" defaultValue="1">
330330
<SelectTrigger
331331
id="location_id"
332332
className="w-full rounded-md border border-gray-300 bg-white text-sm text-black focus:ring-[var(--color-primary)] focus:border-[var(--color-primary)] px-3 py-2"

client/my-app/src/app/components/Forms/EditCameraForm.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export default function EditCameraModal({ camId, open, setOpen }: Props) {
6868
const [locations, setLocations] = useState<ApiLocation[]>([]);
6969
const [loadingLocations, setLoadingLocations] = useState(false);
7070
const [locationsError, setLocationsError] = useState<string>("");
71+
const [currentCamera, setCurrentCamera] = useState<EditForm>();
7172

7273
const [loadingCamera, setLoadingCamera] = useState(false);
7374
const [errMsg, setErrMsg] = useState<string | null>(null);
@@ -103,6 +104,7 @@ export default function EditCameraModal({ camId, open, setOpen }: Props) {
103104
const arr: any[] = Array.isArray(payload?.data) ? payload.data : [];
104105
if (!arr.length) throw new Error("Camera not found.");
105106
const c = arr[0];
107+
setCurrentCamera(c);
106108

107109
const next: EditForm = {
108110
camera_name: c.camera_name ?? "",
@@ -267,7 +269,7 @@ export default function EditCameraModal({ camId, open, setOpen }: Props) {
267269
<AlertDialogContent className="!top-[40%] !-translate-y-[40%] max-w-2xl">
268270
<AlertDialogHeader>
269271
<AlertDialogTitle className="text-[var(--color-primary)]">
270-
Settings – {form.camera_name} (#{camCode})
272+
Settings – {currentCamera?.camera_name} (#{camCode})
271273
</AlertDialogTitle>
272274
<AlertDialogDescription>
273275
Adjust camera configurations and click Save.

client/my-app/src/app/components/Forms/EditEventForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export default function EditEventForm({
146146
<form id="editEventForm" onSubmit={onSubmit} className="space-y-4">
147147
<AlertDialogHeader>
148148
<AlertDialogTitle className="text-[var(--color-primary)]">
149-
Edit Event
149+
Edit Event{item.event_name} (#{`EVT${String(item.event_id).padStart(3, "0")}`})
150150
</AlertDialogTitle>
151151
<AlertDialogDescription>
152152
Update fields and click Save Changes.

0 commit comments

Comments
 (0)