import styled, { css } from 'styled-components';
import { getSpacing, getColorAlias } from '../../../../utils/index.js';

const BottomSheetFooterWrapper = styled.div `
  display: flex;
  padding: ${getSpacing('s04', 's03')};
  box-sizing: border-box;

  ${({ stackedActionButtons }) => stackedActionButtons
    ? css `
          flex-direction: column;
          justify-content: center;

          button {
            &:not(:last-child) {
              margin-bottom: ${getSpacing('s04')};
            }
          }
        `
    : css `
          justify-content: flex-end;

          button {
            &:not(:last-child) {
              margin-right: ${getSpacing('s04')};
            }
          }
        `}

  ${({ pinnedFooter }) => pinnedFooter &&
    css `
      ${getSpacing('s05')};
      position: fixed;
      bottom: 0;
      width: 100%;
      flex-shrink: 0;
      background: ${getColorAlias('containerDefault')};
      box-shadow: rgb(0 0 0 / 20%) 0px -5px 9px -3px;
    `}
`;

export { BottomSheetFooterWrapper };
