import styled from "styled-components";
import { RooAlertProps } from ".";
import { redBackground, whiteBackground, yellowBackground } from "../constants";

const getBackgroundColor = (alertStatus: RooAlertProps["alertStatus"]) => {
  let backgroundColor = whiteBackground;
  if (alertStatus === "error") backgroundColor = redBackground;
  if (alertStatus === "warning") backgroundColor = yellowBackground;
  return backgroundColor;
};

export const Alert = styled.div<RooAlertProps>`
  width: 100%;
  height: 100%;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: ${(props) => getBackgroundColor(props.alertStatus)};
  border-radius: 16px;
  box-shadow: 0px 4px 20px rgba(146, 159, 239, 0.2);
`;

export const AlertLeftContainer = styled.div`
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
`;
