refactor: use primary toast

This commit is contained in:
Yaros
2026-03-26 19:20:11 +01:00
parent c4df4d7852
commit 075f7d507b
+13 -25
View File
@@ -435,21 +435,15 @@ export const toggleArchive = async (asset: AssetResponseDto) => {
asset.isArchived = data.isArchived; asset.isArchived = data.isArchived;
if (asset.isArchived) { if (asset.isArchived) {
toastManager.custom( toastManager.primary(
{ {
component: ToastAction, description: $t('added_to_archive'),
props: { button: {
title: $t('success'), label: $t('undo'),
description: $t('added_to_archive'), onclick: () =>
color: 'success', undoArchiveAssets([asset.id], () => {
button: { asset.isArchived = false;
color: 'secondary', }),
text: $t('undo'),
onClick: () =>
undoArchiveAssets([asset.id], () => {
asset.isArchived = false;
}),
},
}, },
}, },
{ timeout: 5000 }, { timeout: 5000 },
@@ -498,18 +492,12 @@ export const archiveAssets = async (
} }
if (visibility === AssetVisibility.Archive) { if (visibility === AssetVisibility.Archive) {
toastManager.custom( toastManager.primary(
{ {
component: ToastAction, description: $t('archived_count', { values: { count: ids.length } }),
props: { button: {
title: $t('success'), label: $t('undo'),
description: $t('archived_count', { values: { count: ids.length } }), onclick: () => undoArchiveAssets(ids, onUndoArchive),
color: 'success',
button: {
color: 'secondary',
text: $t('undo'),
onClick: () => undoArchiveAssets(ids, onUndoArchive),
},
}, },
}, },
{ timeout: 5000 }, { timeout: 5000 },