feat: Files delete modal error text done.

This commit is contained in:
chiayin
2024-01-18 14:44:35 +08:00
parent b23d89bc38
commit e61c458d92
2 changed files with 9 additions and 7 deletions

View File

@@ -328,12 +328,13 @@ export async function renameModal(rename, type, id) {
* @param { string } files 有關連的檔案
* @param { string } type
* @param { number } id
* @param { string } name 原本的檔案
*/
export async function deleteFileModal(files, type, id) {
export async function deleteFileModal(files, type, id, name) {
const filesStore = FilesStore();
let htmlText = files.length === 0 ? '' : `<div class="w-[227px] text-left mx-auto space-y-1"><p>All related files will be deleted.</p><p>List of file(s) to delete: </p><ul class="list-disc ml-6">${files}</ul></div>`;
let htmlText = files.length === 0 ? `Do you really want to delete <span class="text-primary">${name}</span>?` : `<div class="text-left mx-4 space-y-1"><p class="mb-2">Do you really want to delete <span class="text-primary">${name}</span>?</p><p>The following dependent file(s) will also be deleted:</p><ul class="list-disc ml-6">${files}</ul></div>`;
const result = await Swal.fire({
title: 'ARE YOU SURE?',
title: 'Confirm Deletion?',
html: htmlText,
icon: 'warning',
iconColor: '#FF3366',