@@ -5,6 +5,7 @@ import MuiSelect, { type SelectChangeEvent } from "@mui/material/Select";
55
66import type { ComponentState , ComponentProps } from "@/index" ;
77import { isString } from "@/utils/isString" ;
8+ import { Tooltip } from "./Tooltip" ;
89
910export type SelectOption =
1011 | string
@@ -27,6 +28,7 @@ export function Select({
2728 options,
2829 disabled,
2930 style,
31+ tooltip,
3032 label,
3133 onChange,
3234} : SelectProps ) {
@@ -45,24 +47,26 @@ export function Select({
4547 }
4648 } ;
4749 return (
48- < MuiFormControl variant = "filled" size = "small" style = { style } >
49- { label && < MuiInputLabel id = { `${ id } -label` } > { label } </ MuiInputLabel > }
50- < MuiSelect
51- labelId = { `${ id } -label` }
52- id = { id }
53- name = { name }
54- value = { `${ value } ` }
55- disabled = { disabled }
56- onChange = { handleChange }
57- >
58- { Array . isArray ( options ) &&
59- options . map ( normalizeSelectOption ) . map ( ( [ value , text ] , index ) => (
60- < MuiMenuItem key = { index } value = { value } >
61- { text }
62- </ MuiMenuItem >
63- ) ) }
64- </ MuiSelect >
65- </ MuiFormControl >
50+ < Tooltip title = { tooltip } >
51+ < MuiFormControl variant = "filled" size = "small" style = { style } >
52+ { label && < MuiInputLabel id = { `${ id } -label` } > { label } </ MuiInputLabel > }
53+ < MuiSelect
54+ labelId = { `${ id } -label` }
55+ id = { id }
56+ name = { name }
57+ value = { `${ value } ` }
58+ disabled = { disabled }
59+ onChange = { handleChange }
60+ >
61+ { Array . isArray ( options ) &&
62+ options . map ( normalizeSelectOption ) . map ( ( [ value , text ] , index ) => (
63+ < MuiMenuItem key = { index } value = { value } >
64+ { text }
65+ </ MuiMenuItem >
66+ ) ) }
67+ </ MuiSelect >
68+ </ MuiFormControl >
69+ </ Tooltip >
6670 ) ;
6771}
6872
0 commit comments