-
+ if (canSeePrivacyTab) {
+ result.push({ id: 'privacy', header: 'Privacy' });
+ }
+
+ if (availableRelationshipActions.length > 0 && otherUserInfo) {
+ result.push({ id: 'relationship', header: 'Relationship' });
+ }
+
+ if (hasPermissionForTab(threadInfo, 'delete')) {
+ result.push({ id: 'delete', header: 'Delete' });
+ }
+
+ return result;
+ }, [
+ availableRelationshipActions.length,
+ hasPermissionForTab,
+ otherUserInfo,
+ queuedChanges,
+ threadInfo,
+ ]);
+
+ const tabs = React.useMemo(
+ () => (
+
+ ),
+ [currentTabType, tabsData],
+ );
+
+ const tabContent = React.useMemo(() => {
+ if (!threadInfo) {
+ return null;
+ }
+ if (currentTabType === 'general') {
+ return (
-
- ,
- ];
-
- // This UI needs to be updated to handle sidebars but we haven't gotten
- // there yet. We'll probably end up ripping it out anyways, so for now we
- // are just hiding the privacy tab for any thread that was created as a
- // sidebar
- const canSeePrivacyTab =
- (queuedChanges['parentThreadID'] ?? threadInfo['parentThreadID']) &&
- !threadInfo.sourceMessageID &&
- (threadInfo.type === threadTypes.COMMUNITY_OPEN_SUBTHREAD ||
- threadInfo.type === threadTypes.COMMUNITY_SECRET_SUBTHREAD);
- if (canSeePrivacyTab) {
- tabs.push(
-