mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
update: component for friction as per latest changes.
This commit is contained in:
+20
-2
@@ -3,13 +3,17 @@
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
|
||||
import { FormList, InputCheckbox } from '$lib/elements/forms';
|
||||
import Confirm from '$lib/components/confirm.svelte';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
|
||||
export let showDelete = false;
|
||||
const siteId = $page.params.site;
|
||||
|
||||
let error: string;
|
||||
let confirmedDeletion = false;
|
||||
|
||||
const handleSubmit = async () => {
|
||||
try {
|
||||
await sdk.forProject.sites.delete(siteId);
|
||||
@@ -27,6 +31,20 @@
|
||||
};
|
||||
</script>
|
||||
|
||||
<Confirm onSubmit={handleSubmit} title="Delete site" bind:open={showDelete} bind:error>
|
||||
Are you sure you want to delete this site and all associated deployments from your project?
|
||||
<Confirm
|
||||
onSubmit={handleSubmit}
|
||||
disabled={!confirmedDeletion}
|
||||
title="Delete site"
|
||||
bind:open={showDelete}
|
||||
bind:error>
|
||||
<FormList>
|
||||
Are you sure you want to delete this site and all associated deployments from your project?
|
||||
|
||||
<InputCheckbox
|
||||
size="s"
|
||||
required
|
||||
id="delete_site"
|
||||
bind:checked={confirmedDeletion}
|
||||
label="I understand and confirm" />
|
||||
</FormList>
|
||||
</Confirm>
|
||||
|
||||
Reference in New Issue
Block a user