graylog2-server icon indicating copy to clipboard operation
graylog2-server copied to clipboard

Small refactoring for `SegmentedControl` component.

Open linuspahl opened this issue 9 months ago • 0 comments

Description

Motivation and Context

This PR contains a small refactoring for the SegmentedControl component. We are:

  • renaming the handleChange prop to onChange to follow our naming convention and we are simplifying the related type.
  • implementing a generic type for the value options, to avoid the need to use as when providing the onChange function
  • removing the Array<string> for the data prop. It is being supported by the mantine SegmentedControl component, but having a look at the Select component, future maintenance will be easier if we allow only one format for these options.

/nocl

linuspahl avatar May 08 '24 10:05 linuspahl