import styled from "styled-components";

const ErrorsWrapper = styled.div<{ isSticky: boolean }>`
  position: ${(p) => (p.isSticky ? "sticky" : "static")};
  top: 0;
  background-color: ${(p) => p.theme.colors.uiBackground03};
  width: 100%;
  padding: ${(p) => p.theme.spacing.s};
  margin-bottom: ${(p) => p.theme.spacing.xs};
  border-radius: ${(p) => p.theme.radii.s};
  z-index: 2;
`;

const ErrorsHeader = styled.div`
  display: flex;
  align-items: center;
`;

const WarningWrapper = styled.div`
  width: ${(p) => p.theme.spacing.s};
  height: ${(p) => p.theme.spacing.s};
  svg {
    path {
      fill: ${(p) => p.theme.color.interactive02};
    }
  }
`;

const HeaderText = styled.div`
  ${(p) => p.theme.textStyle.uiM};
  color: ${(p) => p.theme.colors.textHighEmphasis};
  margin-left: ${(p) => p.theme.spacing.xxs};
  font-weight: 600;
`;

const HeaderActions = styled.div`
  display: flex;
  margin-left: auto;
  gap: ${(p) => p.theme.spacing.xxs};
  align-items: center;
`;

const ToggleWrapper = styled.button`
  width: ${(p) => p.theme.spacing.m};
  height: ${(p) => p.theme.spacing.m};
`;

const IconWrapper = styled.button`
  width: ${(p) => p.theme.spacing.s};
  height: ${(p) => p.theme.spacing.s};
`;

const ErrorsContent = styled.div<{ isOpen: boolean }>`
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: ${(p) => (p.isOpen ? "auto" : "0")};
  transition: height 1s ease-in-out;
`;

const Description = styled.div`
  ${(p) => p.theme.textStyle.uiXS};
  color: ${(p) => p.theme.colors.textMediumEmphasis};
  margin-top: ${(p) => p.theme.spacing.xs};
`;

const ErrorListWrapper = styled.ul`
  margin-top: ${(p) => p.theme.spacing.xs};
`;

export {
	ErrorsWrapper,
	ErrorsHeader,
	IconWrapper,
	WarningWrapper,
	HeaderText,
	HeaderActions,
	ErrorsContent,
	ToggleWrapper,
	Description,
	ErrorListWrapper,
};
