All files / buffer-web-components/ScheduleSetting/ScheduleSettingHeader index.jsx

100% Statements 7/7
100% Branches 0/0
100% Functions 1/1
100% Lines 7/7
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 58 59                1x       1x       1x           1x       1x           1x                                   1x                
import React from 'react';
import PropTypes from 'prop-types';
import {
  SectionHeader,
  Select,
  Text,
} from '@bufferapp/components';
 
const textStyle = {
  flexGrow: 1,
};
 
const serviceStyle = {
  textTransform: 'capitalize',
};
 
const timezoneStyle = {
  display: 'flex',
  alignItems: 'center',
  flexDirection: 'row',
};
 
const timezoneItemStyle = {
  marginRight: '0.5rem',
};
 
const ScheduleSettingHeader = ({
  profileName,
  profileService,
  profileServiceType,
  timezoneOptions,
}) => (
  <SectionHeader>
    <span className={textStyle}>
      <Text>
        Posting schedule for the <strong>{profileName}</strong>
        <span className={serviceStyle}> {profileService} {profileServiceType}</span>
      </Text>
    </span>
    <span className={timezoneStyle}>
      <span className={timezoneItemStyle}>
        <Text size={'small'}>Schedule Timezone:</Text>
      </span>
      <span className={timezoneItemStyle}>
        <Select options={timezoneOptions} />
      </span>
    </span>
  </SectionHeader>
);
 
ScheduleSettingHeader.propTypes = {
  profileName: PropTypes.string.isRequired,
  profileService: PropTypes.string.isRequired,
  profileServiceType: PropTypes.string.isRequired,
  timezoneOptions: PropTypes.arrayOf(PropTypes.object).isRequired,
};
 
export default ScheduleSettingHeader;