mirror of
https://github.com/maxdorninger/MediaManager.git
synced 2026-04-17 23:53:27 +02:00
create function for displaying query result toasts to reduce code duplication
This commit is contained in:
@@ -99,3 +99,10 @@ export function formatSecondsToOptimalUnit(seconds: number): string {
|
||||
|
||||
return '0s';
|
||||
}
|
||||
|
||||
export function handleQueryNotificationToast(count: number = 0, query: string = "") {
|
||||
if (count > 0 && query.length > 0) toast.success(`Found ${count} ${count > 1 ? 'result' : 'results'} for search term "${query}".`);
|
||||
else if (count == 0) toast.info(`No results found for "${query}".`);
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user