import { toSubjectReports } from '@/routes/utils' ; import { ConnectedSpace } from '@/services/data/tuples/connected-space-types' ; import { Subject } from '@/services/data/tuples/subject-types' ; import { ICON_SUBJECT } from '@/widgets/basic/constants' ; import { PageHeaderButton } from '@/widgets/basic/page-header-buttons' ; import { Lang } from '@/widgets/langs' ; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' ; import React from 'react' ; import { useHistory } from 'react-router-dom' ; export const HeaderSubjectButton = ( props ) => { const { connectedSpace , subject } = props ; const history = useHistory ( ) ; const onSubjectClicked = ( ) => { history . push ( toSubjectReports ( connectedSpace . connectId , subject . subjectId ) ) ; } ; return < PageHeaderButton tooltip = { Lang . CONSOLE . CONNECTED_SPACE . SUBJECT_REPORTS } onClick = { onSubjectClicked } > < FontAwesomeIcon icon = { ICON_SUBJECT } /> < /PageHeaderButton>; } ;