{"size": 1096, "ext": "js", "max_stars_repo_path": "src/components/BaseTimePicker/BaseTimePicker.js", "max_stars_repo_name": "txstate-etc/txstate-components", "max_stars_repo_stars_event_min_datetime": "2019-09-30T15:13:03.000Z", "max_stars_repo_stars_event_max_datetime": "2019-09-30T15:13:03.000Z", "max_issues_repo_path": "src/components/BaseTimePicker/BaseTimePicker.js", "max_issues_repo_name": "txstate-etc/txstate-components", "max_issues_repo_issues_event_min_datetime": "2019-08-09T12:53:40.000Z", "max_issues_repo_issues_event_max_datetime": "2020-02-18T20:02:28.000Z", "max_forks_repo_path": "src/components/BaseTimePicker/BaseTimePicker.js", "max_forks_repo_name": "txstate-etc/txstate-components", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 27, "max_forks_count": null, "avg_line_length": 24.3555555556, "max_line_length": 93, "alphanum_fraction": 0.6833941606}
import React from 'react'
import {
  MuiPickersUtilsProvider,
  KeyboardTimePicker
} from '@material-ui/pickers'
import DayjsUtils from '@date-io/dayjs'
import PropTypes from 'prop-types'
import dayjs from 'dayjs'

export const BaseTimePicker = props => {
  const { value, placeholder, disabled, onChange, mask, format, variant, emptyLabel } = props

  return (
    <MuiPickersUtilsProvider utils={DayjsUtils}>
      <KeyboardTimePicker
        placeholder={placeholder}
        disabled={disabled}
        format={format}
        emptyLabel={emptyLabel}
        variant={variant}
        value={value}
        onChange={onChange}
        mask={mask}
      />
    </MuiPickersUtilsProvider>
  )
}

BaseTimePicker.defaultProps = {
  variant: 'dialog',
  format: 'hh:mm a',
  mask: '__:__ _m',
  placeholder: '08:00 am'
}

BaseTimePicker.propTypes = {
  variant: PropTypes.oneOf(['dialog', 'inline', 'static']),
  emptyLabel: PropTypes.string,
  format: PropTypes.string,
  value: PropTypes.instanceOf(dayjs),
  onChange: PropTypes.func,
  mask: PropTypes.string,
  placeholder: PropTypes.string
}
