Files
ComfyUI_frontend/src/composables/useWorkflowTemplateSelectorDialog.ts
2025-08-28 01:00:00 +01:00

30 lines
696 B
TypeScript

import WorkflowTemplateSelector from '@/components/custom/widget/WorkflowTemplateSelector.vue'
import { useDialogService } from '@/services/dialogService'
import { useDialogStore } from '@/stores/dialogStore'
const DIALOG_KEY = 'global-workflow-template-selector'
export const useWorkflowTemplateSelectorDialog = () => {
const dialogService = useDialogService()
const dialogStore = useDialogStore()
function hide() {
dialogStore.closeDialog({ key: DIALOG_KEY })
}
function show() {
dialogService.showLayoutDialog({
key: DIALOG_KEY,
component: WorkflowTemplateSelector,
props: {
onClose: hide
}
})
}
return {
show,
hide
}
}