File tree Expand file tree Collapse file tree
[id]/itinerary/_components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -392,8 +392,9 @@ function ItineraryAccordion({ trip }: DailyItineraryAccordionProps) {
392392 buttonText = "Delete"
393393 icon = "Trash"
394394 iconColor = "red-500"
395- text = "Are you sure you want to delete this itinerary item?"
395+ text = "Are you sure you want to delete this item?"
396396 confirmation = "Delete"
397+ showInput = { false }
397398 onConfirm = { ( ) => handleDeleteItem ( item . id ) }
398399 />
399400 </ >
Original file line number Diff line number Diff line change @@ -16,7 +16,8 @@ interface ConfirmationModalProps {
1616 confirmation : string ;
1717 icon ?: string ;
1818 iconColor ?: string ;
19- onConfirm : ( ) => Promise < void > ; // async now
19+ onConfirm : ( ) => Promise < void > ;
20+ showInput ?: boolean ;
2021}
2122
2223function ConfirmationModal ( {
@@ -25,6 +26,7 @@ function ConfirmationModal({
2526 confirmation,
2627 icon,
2728 iconColor = "black" ,
29+ showInput = true ,
2830 onConfirm,
2931} : ConfirmationModalProps ) {
3032 const [ inputValue , setInputValue ] = useState ( "" ) ;
@@ -68,15 +70,17 @@ function ConfirmationModal({
6870 </ DialogHeader >
6971
7072 < div className = "flex flex-col items-center justify-center space-y-5" >
71- < Input
72- value = { inputValue }
73- onChange = { ( e ) => setInputValue ( e . target . value ) }
74- placeholder = { `Type "${ confirmation } " to confirm` }
75- disabled = { loading }
76- />
73+ { showInput && (
74+ < Input
75+ value = { inputValue }
76+ onChange = { ( e ) => setInputValue ( e . target . value ) }
77+ placeholder = { `Type "${ confirmation } " to confirm` }
78+ disabled = { loading }
79+ />
80+ ) }
7781 < Button
7882 variant = "destructive"
79- disabled = { ! isMatch || loading }
83+ disabled = { showInput ? ! isMatch || loading : loading }
8084 onClick = { handleConfirm }
8185 >
8286 { icon && < Icon name = { icon } size = "20" /> }
You can’t perform that action at this time.
0 commit comments