import { css } from 'styled-components';

const getTopPositionStyle = (theme) => {
    return `
    top: ${theme.spacing.s04};
    flex-flow: column nowrap;
  `;
};
const getBottomPositionStyle = (theme) => {
    return `
    bottom: ${theme.spacing.s04};
    flex-flow: column-reverse nowrap;
  `;
};
const getLeftPositionStyle = (theme) => {
    return `
    left: ${theme.spacing.s02};
  `;
};
const getCenterPositionStyle = () => {
    return `
    left: 50%;
    transform: translateX(-50%);
  `;
};
const getRightPositionStyle = (theme) => {
    return `
    right: ${theme.spacing.s02};
  `;
};
const getHorizontalPosition = (position, theme) => {
    switch (position) {
        case 'top':
        case 'bottom':
            return getCenterPositionStyle();
        case 'top-left':
        case 'bottom-left':
            return getLeftPositionStyle(theme);
        case 'top-right':
        case 'bottom-right':
            return getRightPositionStyle(theme);
        default:
            return 'Invalid position!';
    }
};
const getVerticalPosition = (position, theme) => {
    switch (position) {
        case 'top':
        case 'top-left':
        case 'top-right':
            return getTopPositionStyle(theme);
        case 'bottom':
        case 'bottom-left':
        case 'bottom-right':
            return getBottomPositionStyle(theme);
        default:
            return 'Invalid position!';
    }
};
const getToastPosition = (position, theme) => {
    return css `
    ${getVerticalPosition(position, theme)}
    ${getHorizontalPosition(position, theme)}
  `;
};

export { getToastPosition };
