Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ncdiehl11 committed Nov 20, 2024
1 parent 523f0ae commit fa19dbf
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions protocol-designer/src/pages/Designer/DeckSetup/DeckSetupTools.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,14 @@ export function DeckSetupTools(props: DeckSetupToolsProps): JSX.Element | null {
const [tab, setTab] = useState<'hardware' | 'labware'>(
moduleModels?.length === 0 || slot === 'offDeck' ? 'labware' : 'hardware'
)
const allCategoriesExpanded = ALL_ORDERED_CATEGORIES.reduce<CategoryExpand>(
(acc, category) => {
return { ...acc, [category]: true }
},
{}
)
const allCategoriesCollapsed = ALL_ORDERED_CATEGORIES.reduce<CategoryExpand>(
(acc, category) => {
return { ...acc, [category]: false }
},
{}
)

const setAllCategories = (state: boolean): Record<string, boolean> =>
ALL_ORDERED_CATEGORIES.reduce<Record<string, boolean>>(
(acc, category) => ({ ...acc, [category]: state }),
{}
)
const allCategoriesExpanded = setAllCategories(true)
const allCategoriesCollapsed = setAllCategories(false)
const [
areCategoriesExpanded,
setAreCategoriesExpanded,
Expand Down

0 comments on commit fa19dbf

Please sign in to comment.