import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import { Modal, ModalHeader, ModalBody, TabContent, TabPane, Nav, NavItem, NavLink } from 'reactstrap';
import { gettext } from '../../../utils/constants';
import SysAdminShareToUser from './sysadmin-share-to-user';
import SysAdminShareToGroup from './sysadmin-share-to-group';
import '../../../css/share-link-dialog.css';
const propTypes = {
itemName: PropTypes.string.isRequired,
itemPath: PropTypes.string.isRequired,
toggleDialog: PropTypes.func.isRequired,
repoID: PropTypes.string.isRequired,
isGroupOwnedRepo: PropTypes.bool.isRequired,
repoEncrypted: PropTypes.bool,
userPerm: PropTypes.string,
enableDirPrivateShare: PropTypes.bool
};
class SysAdminShareDialog extends React.Component {
constructor(props) {
super(props);
this.state = {
activeTab: this.getInitialActiveTab(),
isRepoOwner: false
};
}
getInitialActiveTab = () => {
return 'shareToUser';
};
toggle = (tab) => {
if (this.state.activeTab !== tab) {
this.setState({ activeTab: tab });
}
};
renderDirContent = () => {
let activeTab = this.state.activeTab;
const { enableDirPrivateShare, isGroupOwnedRepo } = this.props;
return (