|
24 | 24 | import Spinner from '$lib/components/common/Spinner.svelte'; |
25 | 25 | import XMark from '$lib/components/icons/XMark.svelte'; |
26 | 26 | import Textarea from './common/Textarea.svelte'; |
| 27 | + import ConfirmDialog from '$lib/components/common/ConfirmDialog.svelte'; |
27 | 28 |
|
28 | 29 | export let onSubmit: Function = () => {}; |
29 | 30 | export let onDelete: Function = () => {}; |
|
61 | 62 | let loading = false; |
62 | 63 | let showAdvanced = false; |
63 | 64 | let showAccessControlModal = false; |
| 65 | + let showDeleteConfirmDialog = false; |
64 | 66 |
|
65 | 67 | const registerOAuthClientHandler = async () => { |
66 | 68 | if (url === '') { |
|
881 | 883 | </div> |
882 | 884 | {/if} |
883 | 885 |
|
884 | | - <div class="flex justify-between pt-3 text-sm font-medium gap-1.5"> |
885 | | - <div></div> |
886 | | - <div class="flex gap-1.5"> |
| 886 | + <div class="flex justify-between items-center pt-3 text-sm font-medium"> |
| 887 | + <div> |
887 | 888 | {#if edit} |
888 | 889 | <button |
889 | | - class="px-3.5 py-1.5 text-sm font-medium dark:bg-black dark:hover:bg-gray-900 dark:text-white bg-white text-black hover:bg-gray-100 transition rounded-full flex flex-row space-x-1 items-center" |
| 890 | + class="px-1 py-1.5 text-sm font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:underline transition" |
890 | 891 | type="button" |
891 | 892 | on:click={() => { |
892 | | - onDelete(); |
893 | | - show = false; |
| 893 | + showDeleteConfirmDialog = true; |
894 | 894 | }} |
895 | 895 | > |
896 | 896 | {$i18n.t('Delete')} |
897 | 897 | </button> |
898 | 898 | {/if} |
| 899 | + </div> |
899 | 900 |
|
900 | | - <button |
901 | | - class="px-3.5 py-1.5 text-sm font-medium bg-black hover:bg-gray-900 text-white dark:bg-white dark:text-black dark:hover:bg-gray-100 transition rounded-full flex items-center gap-2 whitespace-nowrap {loading |
902 | | - ? ' cursor-not-allowed' |
903 | | - : ''}" |
904 | | - type="submit" |
905 | | - disabled={loading} |
906 | | - > |
907 | | - {$i18n.t('Save')} |
| 901 | + <button |
| 902 | + class="px-3.5 py-1.5 text-sm font-medium bg-black hover:bg-gray-900 text-white dark:bg-white dark:text-black dark:hover:bg-gray-100 transition rounded-full flex items-center gap-2 whitespace-nowrap {loading |
| 903 | + ? ' cursor-not-allowed' |
| 904 | + : ''}" |
| 905 | + type="submit" |
| 906 | + disabled={loading} |
| 907 | + > |
| 908 | + {$i18n.t('Save')} |
908 | 909 |
|
909 | | - {#if loading} |
910 | | - <span class="shrink-0"> |
911 | | - <Spinner /> |
912 | | - </span> |
913 | | - {/if} |
914 | | - </button> |
915 | | - </div> |
| 910 | + {#if loading} |
| 911 | + <span class="shrink-0"> |
| 912 | + <Spinner /> |
| 913 | + </span> |
| 914 | + {/if} |
| 915 | + </button> |
916 | 916 | </div> |
917 | 917 | </form> |
918 | 918 | </div> |
|
921 | 921 | </Modal> |
922 | 922 |
|
923 | 923 | <AccessControlModal bind:show={showAccessControlModal} bind:accessGrants /> |
| 924 | + |
| 925 | +<ConfirmDialog |
| 926 | + bind:show={showDeleteConfirmDialog} |
| 927 | + message={$i18n.t('Are you sure you want to delete this connection? This action cannot be undone.')} |
| 928 | + confirmLabel={$i18n.t('Delete')} |
| 929 | + on:confirm={() => { |
| 930 | + onDelete(); |
| 931 | + show = false; |
| 932 | + }} |
| 933 | +/> |
0 commit comments