All files / src/components/ui/alerts style.ts

0% Statements 0/6
0% Branches 0/4
0% Functions 0/2
0% Lines 0/6

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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57                                                                                                                 
import styled, { css } from "styled-components";
 
interface StyledAlertProps {
  $variant: "warning" | "info";
}
 
export const StyledAlertItem = styled.div`
  padding: 5px 0px;
`;
 
const StyledAlert = styled.div<StyledAlertProps>`
  padding: 5px;
  border-radius: 4px;
  font-size: 12px;
 
  ${StyledAlertItem}:first-child,
  > p:first-child {
    padding-top: 0;
    margin-top: 0;
  }
 
  ${StyledAlertItem}:last-child,
  > p:last-child {
    border-bottom: 0;
    padding-bottom: 0;
    margin-bottom: 0;
  }
 
  ${(props) =>
    props.$variant === "warning"
      ? css`
          background-color: #ffc107;
          color: #000;
 
          ${StyledAlertItem} {
            border-bottom: 1px solid #ffa000;
            padding: 5px 0px;
          }
        `
      : ""}
 
  ${(props) =>
    props.$variant === "info"
      ? css`
          background-color: #03a9f4;
          color: #000;
 
          ${StyledAlertItem} {
            border-bottom: 1px solid #0088c7;
            padding: 5px 0px;
          }
        `
      : ""}
`;
 
export default StyledAlert;