1
1
import { type FC , useRef , useState } from "react" ;
2
2
import { Link as RouterLink , useNavigate } from "react-router-dom" ;
3
- import { useDeletionPopoverState } from "./useDeletionPopoverState " ;
3
+ import { useDeletionDialogState } from "./useDeletionDialogState " ;
4
4
5
5
import { useQuery } from "react-query" ;
6
6
import { workspacesByQuery } from "api/queries/workspaces" ;
@@ -123,7 +123,7 @@ export const TemplatePageHeader: FC<TemplatePageHeaderProps> = ({
123
123
onDeleteTemplate,
124
124
} ) => {
125
125
const navigate = useNavigate ( ) ;
126
- const popoverState = useDeletionPopoverState ( template , onDeleteTemplate ) ;
126
+ const dialogState = useDeletionDialogState ( template , onDeleteTemplate ) ;
127
127
128
128
const queryText = `template:${ template . name } ` ;
129
129
const workspaceCountQuery = useQuery ( {
@@ -153,7 +153,7 @@ export const TemplatePageHeader: FC<TemplatePageHeaderProps> = ({
153
153
< TemplateMenu
154
154
templateVersion = { activeVersion . name }
155
155
templateName = { template . name }
156
- onDelete = { popoverState . openDeleteConfirmation }
156
+ onDelete = { dialogState . openDeleteConfirmation }
157
157
/>
158
158
) }
159
159
</ >
@@ -184,9 +184,9 @@ export const TemplatePageHeader: FC<TemplatePageHeaderProps> = ({
184
184
185
185
{ safeToDeleteTemplate ? (
186
186
< DeleteDialog
187
- isOpen = { popoverState . isDeleteDialogOpen }
188
- onConfirm = { popoverState . confirmDelete }
189
- onCancel = { popoverState . cancelDeleteConfirmation }
187
+ isOpen = { dialogState . isDeleteDialogOpen }
188
+ onConfirm = { dialogState . confirmDelete }
189
+ onCancel = { dialogState . cancelDeleteConfirmation }
190
190
entity = "template"
191
191
name = { template . name }
192
192
/>
@@ -195,8 +195,8 @@ export const TemplatePageHeader: FC<TemplatePageHeaderProps> = ({
195
195
type = "info"
196
196
title = "Unable to delete"
197
197
hideCancel = { false }
198
- open = { popoverState . isDeleteDialogOpen }
199
- onClose = { popoverState . cancelDeleteConfirmation }
198
+ open = { dialogState . isDeleteDialogOpen }
199
+ onClose = { dialogState . cancelDeleteConfirmation }
200
200
confirmText = "See workspaces"
201
201
confirmLoading = { workspaceCountQuery . status !== "success" }
202
202
onConfirm = { ( ) => {
0 commit comments