Added delete confirmation dialogs for Prompts, Tools, and Functions.
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
import ValvesModal from './common/ValvesModal.svelte';
|
||||
import ManifestModal from './common/ManifestModal.svelte';
|
||||
import Heart from '../icons/Heart.svelte';
|
||||
import DeleteConfirmDialog from '$lib/components/common/ConfirmDialog.svelte';
|
||||
|
||||
const i18n = getContext('i18n');
|
||||
|
||||
@@ -36,6 +37,9 @@
|
||||
let showValvesModal = false;
|
||||
let selectedTool = null;
|
||||
|
||||
let showDeleteConfirm = false;
|
||||
let deleteTool = null;
|
||||
|
||||
const shareHandler = async (tool) => {
|
||||
console.log(tool);
|
||||
};
|
||||
@@ -240,7 +244,8 @@
|
||||
exportHandler(tool);
|
||||
}}
|
||||
deleteHandler={async () => {
|
||||
deleteHandler(tool);
|
||||
deleteTool = tool;
|
||||
showDeleteConfirm = true;
|
||||
}}
|
||||
onClose={() => {}}
|
||||
>
|
||||
@@ -370,6 +375,18 @@
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<DeleteConfirmDialog
|
||||
bind:show={showDeleteConfirm}
|
||||
title={$i18n.t('Delete tool?')}
|
||||
on:confirm={() => {
|
||||
deleteHandler(deleteTool);
|
||||
}}
|
||||
>
|
||||
<div class=" text-sm text-gray-500">
|
||||
{$i18n.t('This will delete')} <span class=" font-semibold">{deleteTool.name}</span>.
|
||||
</div>
|
||||
</DeleteConfirmDialog>
|
||||
|
||||
<ValvesModal bind:show={showValvesModal} type="tool" id={selectedTool?.id ?? null} />
|
||||
<ManifestModal bind:show={showManifestModal} manifest={selectedTool?.meta?.manifest ?? {}} />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user