mattermost-mobile/app/components/chips/selected_user_chip.tsx
Mattermost Build 3c3973eaa5
Add onPress on full chip (#9134) (#9154)
* Add onPress on full chip

* Address feedback

* Fix test

(cherry picked from commit d4fb05d4bb)

Co-authored-by: Daniel Espino García <larkox@gmail.com>
2025-09-29 08:32:50 +03:00

33 lines
840 B
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React, {useMemo} from 'react';
import UserChip from './user_chip';
import type UserModel from '@typings/database/models/servers/user';
type SelectedChipProps = {
user: UserModel | UserProfile;
onPress: (id: string) => void;
testID?: string;
teammateNameDisplay: string;
}
export default function SelectedUserChip({
testID,
user,
teammateNameDisplay,
onPress,
}: SelectedChipProps) {
const action = useMemo(() => ({icon: 'remove' as const, onPress}), [onPress]);
return (
<UserChip
testID={testID}
action={action}
showAnimation={true}
teammateNameDisplay={teammateNameDisplay}
user={user}
/>
);
}