{"size": 803, "ext": "js", "max_stars_repo_path": "web-client/src/presenter/computeds/documentViewerLinksHelper.js", "max_stars_repo_name": "codyseibert/ef-cms", "max_stars_repo_stars_event_min_datetime": "2018-09-16T17:05:55.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-28T15:30:54.000Z", "max_issues_repo_path": "web-client/src/presenter/computeds/documentViewerLinksHelper.js", "max_issues_repo_name": "codyseibert/ef-cms", "max_issues_repo_issues_event_min_datetime": "2018-10-10T18:39:26.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T16:30:12.000Z", "max_forks_repo_path": "web-client/src/presenter/computeds/documentViewerLinksHelper.js", "max_forks_repo_name": "codyseibert/ef-cms", "max_forks_repo_forks_event_min_datetime": "2018-10-09T21:02:23.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-22T10:09:37.000Z"}
{"max_stars_count": 52, "max_issues_count": 2108, "max_forks_count": 23, "avg_line_length": 42.2631578947, "max_line_length": 141, "alphanum_fraction": 0.7721046077}
import { state } from 'cerebral';

export const documentViewerLinksHelper = get => {
  const caseDetail = get(state.caseDetail);

  const viewerDocumentToDisplay = get(state.viewerDocumentToDisplay);

  if (!viewerDocumentToDisplay) {
    return {};
  }

  return {
    completeQcLink: `/case-detail/${caseDetail.docketNumber}/documents/${viewerDocumentToDisplay.docketEntryId}/edit`,
    documentViewerLink: `/case-detail/${caseDetail.docketNumber}/document-view?docketEntryId=${viewerDocumentToDisplay.docketEntryId}`,
    reviewAndServePetitionLink: `/case-detail/${caseDetail.docketNumber}/petition-qc/document-view/${viewerDocumentToDisplay.docketEntryId}`,
    signStipulatedDecisionLink: `/case-detail/${caseDetail.docketNumber}/edit-order/${viewerDocumentToDisplay.docketEntryId}/sign`,
  };
};
