// @flow
import styled from 'styled-components';

import { Th as RsrTh } from 'react-super-responsive-table';
import type { ThProps } from './th.proptypes';
import { getPaletteColor } from '../../../../mixins/branding';
import type { PatchworkComponent } from '../../../../types';
import { bpLarge } from '../../../../breakpoints';
import {
  getCellPaddingMobile,
  getCellPaddingDesktop,
} from '../table.css-rules';

export const Th: PatchworkComponent<ThProps> = styled(RsrTh)`
  text-align: left;
  padding: ${getCellPaddingDesktop};
  border-bottom: solid 1px ${getPaletteColor('greyscale-light')};
  font-weight: normal;

  @media (max-width: ${bpLarge}) {
    display: block;
    padding: ${getCellPaddingMobile};
  }
`;

Th.displayName = 'Th';
