import { __, isRTL } from '@wordpress/i18n'; import { Icon, chevronRight, chevronLeft } from '@wordpress/icons'; import classNames from 'classnames'; import { playIcon, restartIcon, toursIcon, } from '@help-center/components/tours/icons'; import { useGlobalSyncStore } from '@help-center/state/globals-sync'; import { useTourStore } from '@help-center/state/tours'; import tours from '@help-center/tours/tours'; export const ToursDashboard = ({ onOpen, classes }) => { const { startTour } = useTourStore(); const { setVisibility } = useGlobalSyncStore(); const availableTours = Object.values(tours).filter( (tour) => tour.settings.startFrom.includes(window.location.href) || !tour.settings.startFrom, ); return ( 0, }, )}> {__('Tours', 'extendify-local')} {__('Learn more about your WordPress admin', 'extendify-local')} {availableTours.length > 0 && ( { setVisibility('minimized'); startTour(availableTours[0]); }}> {__('Tour this page', 'extendify-local')} )} ); }; export const Tours = () => { const { wasCompleted, startTour } = useTourStore(); const { setVisibility } = useGlobalSyncStore(); return ( {Object.values(tours).map((tourData) => { const { id, title } = tourData; return ( { setVisibility('minimized'); startTour(tourData); }}> {title} {wasCompleted(id) ? ( ) : ( )} ); })} ); }; export const routes = [ { slug: 'tours', title: __('Tours', 'extendify-local'), component: Tours, }, ];
{__('Learn more about your WordPress admin', 'extendify-local')}