Skip to content

Commit 497943c

Browse files
committed
chore: specify type
1 parent bf56971 commit 497943c

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

packages/docs-app/src/examples/core-examples/common/textAlignmentSelect.tsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,14 @@ interface AlignmentSelectProps {
1818
onChange: (align: TextAlignment) => void;
1919
}
2020

21-
export const TextAlignmentSelect: React.FC<AlignmentSelectProps> = ({ align, label = "Align text", onChange }) => {
22-
const handleChange = React.useCallback((value: string) => onChange(value as TextAlignment), [onChange]);
23-
return (
24-
<FormGroup label={label}>
25-
<SegmentedControl fill={true} options={options} onValueChange={handleChange} size="small" value={align} />
26-
</FormGroup>
27-
);
28-
};
21+
export const TextAlignmentSelect: React.FC<AlignmentSelectProps> = ({ align, label = "Align text", onChange }) => (
22+
<FormGroup label={label}>
23+
<SegmentedControl<TextAlignment>
24+
fill={true}
25+
options={options}
26+
onValueChange={onChange}
27+
size="small"
28+
value={align}
29+
/>
30+
</FormGroup>
31+
);

0 commit comments

Comments
 (0)