fix: misc issues

This commit is contained in:
Jannat Patel
2024-07-16 16:11:24 +05:30
parent 0183677494
commit 25a2d82e82
7 changed files with 49 additions and 35 deletions

View File

@@ -79,15 +79,18 @@ export function getFileSize(file_size) {
return value
}
export function showToast(title, text, icon) {
export function showToast(title, text, icon, iconClasses = null) {
if (!iconClasses) {
iconClasses =
icon == 'check'
? 'bg-green-600 text-white rounded-md p-px'
: 'bg-red-600 text-white rounded-md p-px'
}
createToast({
title: title,
text: htmlToText(text),
icon: icon,
iconClasses:
icon == 'check'
? 'bg-green-600 text-white rounded-md p-px'
: 'bg-red-600 text-white rounded-md p-px',
iconClasses: iconClasses,
position: icon == 'check' ? 'bottom-right' : 'top-center',
timeout: 5,
})