Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed select
Browse files Browse the repository at this point in the history
ValeriaMaltseva committed Jan 24, 2025
1 parent 9613b6b commit 627e1e8
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ interface IUsersRolesDropdownProps {
}

interface IRenderSelectProps {
options?: Array<{ value: number, label: ReactNode }>
options?: Array<{ value: string, label: ReactNode }>
placeholder: string
handleOnChange: any
selectedOptions: number[]
@@ -88,6 +88,7 @@ export const UsersRolesDropdown = ({ userList, roleList, handleClose }: IUsersRo
<Select
mode="multiple"
onChange={ handleOnChange }
optionFilterProp="value"
options={ options }
placeholder={ t(placeholder) }
showSearch
@@ -98,8 +99,8 @@ export const UsersRolesDropdown = ({ userList, roleList, handleClose }: IUsersRo
const renderUsers = (): React.JSX.Element => {
const options = userList?.items
?.filter(item => userData?.id !== item.id)
?.map(item => ({
value: item.id,
?.map((item, index) => ({
value: `${index}-${item?.username}`,
label: renderLabel({ labelName: item?.username, iconName: 'user' })
}))

@@ -112,8 +113,8 @@ export const UsersRolesDropdown = ({ userList, roleList, handleClose }: IUsersRo
}

const renderRoles = (): React.JSX.Element => {
const options = roleList?.items?.map(item => ({
value: item.id,
const options = roleList?.items?.map((item, index) => ({
value: `${index}-${item?.name}`,
label: renderLabel({ labelName: item?.name, iconName: 'shield' })
}))

0 comments on commit 627e1e8

Please sign in to comment.