Skip to content

Commit

Permalink
Optimized (#364)
Browse files Browse the repository at this point in the history
  • Loading branch information
acidjunk authored Oct 13, 2023
1 parent 6c4f1cb commit 829503e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC, useCallback, useState } from 'react';
import React, { FC, useState } from 'react';
import { EuiSideNav, EuiSpacer } from '@elastic/eui';
import { useRouter } from 'next/router';
import { useTranslations } from 'next-intl';
Expand All @@ -22,9 +22,9 @@ export const WFOSidebar: FC = () => {
const router = useRouter();
const [isSideNavOpenOnMobile, setIsSideNavOpenOnMobile] = useState(false);

const toggleMobile = useCallback(() => {
const toggleMobile = () => {
setIsSideNavOpenOnMobile((openState) => !openState);
}, [setIsSideNavOpenOnMobile]);
};

return (
<EuiSideNav
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,12 @@ export const WFOStartTaskButtonComboBox = () => {
'taskWorkflows',
);

const taskList: WorkflowComboBoxOption[] =
data?.workflows.page
.map((workflow) => {
return {
label: workflow.description,
data: { workflowName: workflow.name },
} as WorkflowComboBoxOption;
})
.sort((a, b) => a.label.localeCompare(b.label)) ?? [];
const taskList: WorkflowComboBoxOption[] = (data?.workflows.page || [])
.map(({ name, description }) => ({
label: description ?? '',
data: { workflowName: name },
}))
.sort((a, b) => a.label.localeCompare(b.label));

const handleOptionChange = (selectedProduct: WorkflowComboBoxOption) => {
const { workflowName } = selectedProduct.data;
Expand Down

0 comments on commit 829503e

Please sign in to comment.