Skip to content

Commit

Permalink
feat: add gotoriskgrading button
Browse files Browse the repository at this point in the history
  • Loading branch information
deeonwuli committed Nov 12, 2024
1 parent 9ef3aa2 commit a1e6348
Showing 1 changed file with 33 additions and 10 deletions.
43 changes: 33 additions & 10 deletions src/webapp/pages/event-tracker/EventTrackerPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ export const EventTrackerPage: React.FC = React.memo(() => {
});
}, [goTo]);

const goToRiskGradingForm = useCallback(() => {
goTo(RouteName.CREATE_FORM, {
formType: "risk-assessment-grading",
});
}, [goTo]);

const { performanceMetrics717, isLoading: _717CardsLoading } = use717Performance(
"event_tracker",
id
Expand Down Expand Up @@ -127,16 +133,28 @@ export const EventTrackerPage: React.FC = React.memo(() => {
{i18n.t("Create Risk Assessment")}
</Button>
) : (
<Button
variant="outlined"
color="secondary"
startIcon={<AddCircleOutline />}
onClick={() => {
goToRiskSummaryForm();
}}
>
{i18n.t("Add new Assessment")}
</Button>
<ButtonContainer>
<Button
variant="outlined"
color="secondary"
startIcon={<AddCircleOutline />}
onClick={() => {
goToRiskSummaryForm();
}}
>
{i18n.t("Add new Assessment")}
</Button>
<Button
variant="outlined"
color="secondary"
startIcon={<AddCircleOutline />}
onClick={() => {
goToRiskGradingForm();
}}
>
{i18n.t("Add new Grade")}
</Button>
</ButtonContainer>
)
}
titleVariant="secondary"
Expand Down Expand Up @@ -244,3 +262,8 @@ export const EventTrackerPage: React.FC = React.memo(() => {
const DurationFilterContainer = styled.div`
max-width: 250px;
`;

const ButtonContainer = styled.div`
display: flex;
gap: 8px;
`;

0 comments on commit a1e6348

Please sign in to comment.