// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React from 'react';
import CopyChannelLinkOption from '@components/channel_actions/copy_channel_link_option';
import {General} from '@constants';
import PlaybookRunsOption from '@playbooks/components/channel_actions/playbook_runs_option';
import {isTypeDMorGM} from '@utils/channel';
import AddMembers from './add_members';
import AutoFollowThreads from './auto_follow_threads';
import ChannelFiles from './channel_files';
import ChannelSettings from './channel_settings';
import IgnoreMentions from './ignore_mentions';
import Members from './members';
import MyAutotranslation from './my_autotranslation';
import NotificationPreference from './notification_preference';
import PinnedMessages from './pinned_messages';
import ResetChannelPosts from './reset_channel_posts';
type Props = {
channelId: string;
type?: ChannelType;
callsEnabled: boolean;
canManageMembers: boolean;
isCRTEnabled: boolean;
isPlaybooksEnabled: boolean;
hasChannelSettingsActions: boolean;
isAutotranslationEnabledForThisChannel: boolean;
channelDisplayName: string;
}
const Options = ({
channelId,
type,
callsEnabled,
canManageMembers,
isCRTEnabled,
isPlaybooksEnabled,
hasChannelSettingsActions,
isAutotranslationEnabledForThisChannel,
channelDisplayName,
}: Props) => {
const isDMorGM = isTypeDMorGM(type);
return (
<>
{hasChannelSettingsActions && (
)}
{type !== General.DM_CHANNEL && (
<>
{isCRTEnabled && (
)}
>
)}
{isAutotranslationEnabledForThisChannel && (
)}
{isPlaybooksEnabled && !isDMorGM &&
}
{type !== General.DM_CHANNEL &&
}
{canManageMembers &&
}
{callsEnabled && !isDMorGM && // if calls is not enabled, copy link will show in the channel actions
}
>
);
};
export default Options;