@@ -68,6 +68,7 @@ export default function SpotDetailModal({
6868 spotId,
6969 spots,
7070 readOnly = false ,
71+ allowVisitRecording = false ,
7172 onClose,
7273 onVisitChange,
7374 onVisitRecorded,
@@ -86,6 +87,10 @@ export default function SpotDetailModal({
8687 * (このスポットは表示中の種別の地図では表示できないため)
8788 */
8889 readOnly ?: boolean ;
90+ /** readOnly(重ね表示)でも「訪問を記録」だけは許可する。地図で経路表示中に、
91+ * 重ね表示した別種別スポットへ種別を切り替えずに訪問記録し、リストから外すために使う。
92+ * スポットの編集・削除や訪問予定/予定リスト追加は readOnly のまま隠す */
93+ allowVisitRecording ?: boolean ;
8994 onClose : ( ) => void ;
9095 /** 訪問記録の追加・削除があったときに呼ばれる(呼び出し元の一覧・バッジ更新用) */
9196 onVisitChange ?: ( ) => void ;
@@ -481,25 +486,31 @@ export default function SpotDetailModal({
481486 </ p >
482487 ) }
483488 </ div >
484- { ! readOnly && (
489+ { ( ! readOnly || allowVisitRecording ) && (
485490 < div className = "flex flex-wrap justify-end gap-2" >
486- < button
487- onClick = { toggleVisitPlan }
488- disabled = { planUpdating }
489- className = { `rounded-lg px-3 py-1.5 text-sm font-medium disabled:opacity-50 ${
490- planned
491- ? "border border-gray-300 text-gray-600"
492- : "border border-blue-600 text-blue-600"
493- } `}
494- >
495- { planned ? "訪問予定をはずす" : "訪問予定にする" }
496- </ button >
497- < button
498- onClick = { ( ) => setShowAddToList ( true ) }
499- className = "rounded-lg border border-blue-600 px-3 py-1.5 text-sm font-medium text-blue-600"
500- >
501- 予定リストに追加
502- </ button >
491+ { /* スポットの管理系(訪問予定・予定リスト)は通常表示のときだけ。
492+ readOnly(重ね表示)では訪問記録だけを許可する */ }
493+ { ! readOnly && (
494+ < >
495+ < button
496+ onClick = { toggleVisitPlan }
497+ disabled = { planUpdating }
498+ className = { `rounded-lg px-3 py-1.5 text-sm font-medium disabled:opacity-50 ${
499+ planned
500+ ? "border border-gray-300 text-gray-600"
501+ : "border border-blue-600 text-blue-600"
502+ } `}
503+ >
504+ { planned ? "訪問予定をはずす" : "訪問予定にする" }
505+ </ button >
506+ < button
507+ onClick = { ( ) => setShowAddToList ( true ) }
508+ className = "rounded-lg border border-blue-600 px-3 py-1.5 text-sm font-medium text-blue-600"
509+ >
510+ 予定リストに追加
511+ </ button >
512+ </ >
513+ ) }
503514 < button
504515 onClick = { ( ) => setShowForm ( true ) }
505516 className = "rounded-lg bg-blue-600 px-3 py-1.5 text-sm font-medium text-white"
@@ -642,7 +653,7 @@ export default function SpotDetailModal({
642653 < VisitFormModal
643654 spotId = { spot . id }
644655 spotName = { spot . name }
645- reviewsEnabled = { reviewsEnabled }
656+ reviewsEnabled = { ! readOnly && reviewsEnabled }
646657 onClose = { ( ) => setShowForm ( false ) }
647658 onSaved = { ( ) => {
648659 setShowForm ( false ) ;
@@ -663,7 +674,7 @@ export default function SpotDetailModal({
663674 < VisitFormModal
664675 spotId = { spot . id }
665676 spotName = { spot . name }
666- reviewsEnabled = { reviewsEnabled }
677+ reviewsEnabled = { ! readOnly && reviewsEnabled }
667678 visit = { editingVisit }
668679 onClose = { ( ) => setEditingVisit ( null ) }
669680 onSaved = { ( ) => {
0 commit comments