All files / molecules/Toast utils.tsx

50% Statements 1/2
100% Branches 0/0
0% Functions 0/1
50% Lines 1/2

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39                10x                                                            
import {
  XFill,
  Warning,
  SuccessIcon,
  InformationCircle,
} from '@sb/ui/components/atoms/Icons/web/Icons';
import { ToastVariant, ToastVariantProps } from './Toast.types';
 
export const TOAST_VARIANTS: Record<ToastVariant, ToastVariantProps> = {
  success: {
    toastContentColor: 'var(--toast-success)',
    backgroundColor: 'var(--alternate-background)',
    iconBackground: 'var(--toast-success)',
    icon: <SuccessIcon color="var(--toast-success-icon)" className="rounded-full" size={17} />,
  },
  error: {
    backgroundColor: 'var(--alternate-background)',
    toastContentColor: 'var(--toast-error)',
    iconBackground: 'var(--toast-error-icon)',
    icon: <XFill />,
  },
  warning: {
    backgroundColor: 'var(--alternate-background)',
    toastContentColor: 'var(--toast-warning)',
    iconBackground: 'var(--toast-warning-icon)',
    icon: <Warning color="white" size={17} />,
  },
  info: {
    backgroundColor: 'var(--alternate-background)',
    iconBackground: 'var(--color-secondary)',
    toastContentColor: 'var(--color-primary)',
    icon: <InformationCircle color="white" size={17} />,
  },
};
 
export function secondsToMillis(seconds: number) {
  return seconds * 1000;
}