diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/team_in_list/team_in_list.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/team_in_list/team_in_list.tsx index d845659d67779..58aa5855151f9 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/team_in_list/team_in_list.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/team_in_list/team_in_list.tsx @@ -1,7 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; +import classNames from 'classnames'; +import React, {memo, useCallback} from 'react'; import {FormattedMessage} from 'react-intl'; import type {Team} from '@mattermost/types/teams'; @@ -16,41 +17,43 @@ type Props = { isDisabled: boolean; } -export default class TeamInList extends React.PureComponent { - handleRemoveTeam = () => { - const {team, isDisabled, onRemoveTeam} = this.props; +const TeamInList = ({ + team, + isDisabled, + onRemoveTeam, +}: Props) => { + const handleRemoveTeam = useCallback(() => { if (isDisabled) { return; } onRemoveTeam(team.id); - }; - - render() { - const {team, isDisabled} = this.props; - return ( -
-
- -
-
{team.display_name}
-
+ }, [isDisabled, team.id, onRemoveTeam]); + + return ( +
+
+ +
+
{team.display_name}
- - -
- ); - } -} + + + +
+ ); +}; + +export default memo(TeamInList);