/**
* WordPress dependencies
*/
import { MenuGroup, MenuItem } from '@safe-wordpress/components';
import { useDispatch, useSelect } from '@safe-wordpress/data';
import { _x } from '@safe-wordpress/i18n';
/**
* External dependencies
*/
import { store as NC_CALENDAR } from '@nelio-content/calendar';
import { ContextualHelp } from '@nelio-content/components';
import {
store as NC_DATA,
useFeatureGuard,
useIsFeatureEnabled,
} from '@nelio-content/data';
/**
* Internal dependencies
*/
import { ExportDialog } from '../../../export-dialog';
import { walkthrough } from '~/nelio-content-pages/calendar/walkthrough';
export type ToolsProps = {
readonly close: () => void;
};
export const Tools = ( { close }: ToolsProps ): JSX.Element => {
const canExportCalendar = useIsFeatureEnabled( 'calendar/export' );
const exportCalendarGuard = useFeatureGuard( 'calendar/export' );
const canPauseCalendar = useSelect(
( select ) => select( NC_DATA ).canCurrentUserManagePlugin(),
[]
);
const isSocialPublicationPaused = useSelect(
( select ) => select( NC_DATA ).isSocialPublicationPaused(),
[]
);
const isSocialPublicationStatusBeingSynched = useSelect(
( select ) => select( NC_DATA ).isSocialPublicationStatusBeingSynched(),
[]
);
const areThereActiveFilters = useSelect(
( select ) => select( NC_CALENDAR ).areThereActiveFilters(),
[]
);
const { toggleSocialPublicationStatus } = useDispatch( NC_DATA );
const { openExportDialog } = useDispatch( NC_CALENDAR );
const { clearFilters } = useDispatch( NC_CALENDAR );
return (
);
};
// ============
// HELPER VIEWS
// ============
type HMIProps = {
readonly runWalkthrough: () => void;
};
const HelpMenuItem = ( close: () => void ) => ( props: HMIProps ) => (
);