import { ProjectListProvider, useProjectListContext, } from '../context/project-list-context' import { ColorPickerProvider } from '../context/color-picker-context' import * as eventTracking from '../../../infrastructure/event-tracking' import { Col, Row } from 'react-bootstrap' import { useTranslation } from 'react-i18next' import useWaitForI18n from '../../../shared/hooks/use-wait-for-i18n' import CurrentPlanWidget from './current-plan-widget/current-plan-widget' import NewProjectButton from './new-project-button' import ProjectListTable from './table/project-list-table' import SurveyWidget from './survey-widget' import WelcomeMessage from './welcome-message' import LoadingBranded from '../../../shared/components/loading-branded' import SystemMessages from './notifications/system-messages' import UserNotifications from './notifications/user-notifications' import SearchForm from './search-form' import ProjectsDropdown from './dropdown/projects-dropdown' import SortByDropdown from './dropdown/sort-by-dropdown' import ProjectTools from './table/project-tools/project-tools' import ProjectListTitle from './title/project-list-title' import Sidebar from './sidebar/sidebar' import LoadMore from './load-more' import { useEffect } from 'react' import getMeta from '../../../utils/meta' import WelcomeMessageNew from './welcome-message-new' import withErrorBoundary from '../../../infrastructure/error-boundary' import { GenericErrorBoundaryFallback } from '../../../shared/components/generic-error-boundary-fallback' function ProjectListRoot() { const { isReady } = useWaitForI18n() return isReady ? ( ) : null } function ProjectListPageContent() { const { totalProjectsCount, error, isLoading, loadProgress, searchText, setSearchText, selectedProjects, filter, tags, selectedTagId, } = useProjectListContext() const selectedTag = tags.find(tag => tag._id === selectedTagId) const welcomePageRedesignVariant = getMeta( 'ol-welcomePageRedesignVariant' ) as 'enabled' | 'default' useEffect(() => { eventTracking.sendMB('loads_v2_dash', {}) }, []) return isLoading ? (
) : ( <>
{totalProjectsCount > 0 ? ( <>
{error ? : ''}
{selectedProjects.length === 0 ? ( ) : ( )}
) : (
{error ? : ''} {welcomePageRedesignVariant === 'enabled' ? ( ) : ( )}
)}
) } function DashApiError() { const { t } = useTranslation() return (
{t('generic_something_went_wrong')}
) } export default withErrorBoundary(ProjectListRoot, GenericErrorBoundaryFallback)