{"size": 1135, "ext": "js", "max_stars_repo_path": "web/src/collection/components/FileSummaryHeader/LocalFileSummaryHeader.js", "max_stars_repo_name": "benetech/Winnow2.0", "max_stars_repo_stars_event_min_datetime": "2019-12-16T21:22:14.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-25T16:05:32.000Z", "max_issues_repo_path": "web/src/collection/components/FileSummaryHeader/LocalFileSummaryHeader.js", "max_issues_repo_name": "benetech/Winnow2.0", "max_issues_repo_issues_event_min_datetime": "2019-10-28T16:24:45.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T13:12:15.000Z", "max_forks_repo_path": "web/src/collection/components/FileSummaryHeader/LocalFileSummaryHeader.js", "max_forks_repo_name": "benetech/Winnow2.0", "max_forks_repo_forks_event_min_datetime": "2019-10-09T16:20:38.000Z", "max_forks_repo_forks_event_max_datetime": "2021-12-22T18:44:45.000Z"}
{"max_stars_count": 26, "max_issues_count": 325, "max_forks_count": 9, "avg_line_length": 27.0238095238, "max_line_length": 73, "alphanum_fraction": 0.6916299559}
import React from "react";
import PropTypes from "prop-types";
import { FileType } from "../../prop-types/FileType";
import FileSummary from "../FileSummary";
import useTheme from "@material-ui/styles/useTheme";
import { useMediaQuery } from "@material-ui/core";
import BasicFileSummaryHeader from "./BasicFileSummaryHeader";

/**
 * Check if the screen is small.
 */
function useSmallScreen() {
  const theme = useTheme();
  return useMediaQuery(theme.breakpoints.down("md"));
}

function LocalFileSummaryHeader(props) {
  const { file, className, ...other } = props;
  const small = useSmallScreen();

  return (
    <BasicFileSummaryHeader file={file} className={className} {...other}>
      <FileSummary.Name />
      <FileSummary.Fingerprint />
      <FileSummary.Duration />
      {!small && <FileSummary.CreationDate />}
      {!small && <FileSummary.HasExif />}
      {!small && <FileSummary.HasAudio />}
    </BasicFileSummaryHeader>
  );
}

LocalFileSummaryHeader.propTypes = {
  /**
   * Video file to be displayed
   */
  file: FileType.isRequired,
  className: PropTypes.string,
};

export default LocalFileSummaryHeader;
