// @flow
import styled from 'styled-components';
import type { GridItemProps } from './grid-item.proptypes';
import type { PatchworkComponent } from '../../../../types';
import {
  widthSm,
  widthMd,
  widthLg,
  widthXl,
  paddingLeftSm,
  paddingLeftMd,
  paddingLeftLg,
  paddingLeftXl,
} from './grid-item.css-rules';
import { bpMedium, bpLarge, bpXLarge } from '../../../../breakpoints';

export const GridItem: PatchworkComponent<GridItemProps> = styled.div`
  width: ${widthSm};
  padding-left: ${paddingLeftSm};

  @media (min-width: ${bpMedium}) {
    width: ${widthMd};
    padding-left: ${paddingLeftMd};
  }

  @media (min-width: ${bpLarge}) {
    width: ${widthLg};
    padding-left: ${paddingLeftLg};
  }

  @media (min-width: ${bpXLarge}) {
    width: ${widthXl};
    padding-left: ${paddingLeftXl};
  }
`;

GridItem.displayName = 'GridItem';
