20 lines
704 B
TypeScript
20 lines
704 B
TypeScript
import type { IconName } from '../../atoms/icon';
|
|
import type { ToastTone } from './types';
|
|
|
|
export const TOAST_ICONS: Record<ToastTone, IconName> = {
|
|
info: 'info',
|
|
success: 'check-circle',
|
|
error: 'alert',
|
|
};
|
|
|
|
/**
|
|
* Every toast closes by itself (0019); sonner pauses the clock while it is hovered or focused, or
|
|
* the tab is hidden. About 4
|
|
* seconds to read one line, 6 when there is an action to reach. An error says what failed, why
|
|
* and what to do, so it stays 8 seconds, 10 with its action.
|
|
*/
|
|
export const TOAST_DURATION_MS = 4000;
|
|
export const TOAST_WITH_ACTION_DURATION_MS = 6000;
|
|
export const TOAST_ERROR_DURATION_MS = 8000;
|
|
export const TOAST_ERROR_WITH_ACTION_DURATION_MS = 10000;
|