mattermost-mobile/app/components/common_post_options/base_option/index.tsx
Daniel Espino García 0c4a42a06a
Remove tand prevent double tap (#9078)
* Remove the t function and all wrong uses of preventDoubleTap

* Fix existing typo

* Fix tests

* Address comments

* Fix test
2025-08-25 12:03:01 +02:00

37 lines
842 B
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React from 'react';
import {useIntl, type MessageDescriptor} from 'react-intl';
import OptionItem from '@components/option_item';
type BaseOptionType = {
message: MessageDescriptor;
iconName: string;
isDestructive?: boolean;
onPress: () => void;
testID: string;
}
const BaseOption = ({
message,
iconName,
isDestructive = false,
onPress,
testID,
}: BaseOptionType) => {
const intl = useIntl();
return (
<OptionItem
action={onPress}
destructive={isDestructive}
icon={iconName}
label={intl.formatMessage(message)}
testID={testID}
type='default'
/>
);
};
export default BaseOption;