import { FC } from 'react' import TrackChangesToggle from '@/features/source-editor/components/review-panel/toolbar/track-changes-toggle' import { useProjectContext } from '@/shared/context/project-context' import { usePermissionsContext } from '@/features/ide-react/context/permissions-context' import { useTranslation } from 'react-i18next' import { useTrackChangesStateActionsContext, useTrackChangesStateContext, } from '../context/track-changes-state-context' import { useChangesUsersContext } from '../context/changes-users-context' import { buildName } from '../utils/build-name' export const ReviewPanelTrackChangesMenu: FC = () => { const { t } = useTranslation() const permissions = usePermissionsContext() const project = useProjectContext() const trackChanges = useTrackChangesStateContext() const { saveTrackChanges } = useTrackChangesStateActionsContext() const changesUsers = useChangesUsersContext() if (trackChanges === undefined || !changesUsers) { return null } const { onForEveryone, onForGuests, onForMembers } = trackChanges const canToggle = project.features.trackChanges && permissions.write return (