import { useQueryClient } from '@tanstack/react-query' import { ArrowRight, Loader2 } from 'lucide-react' import Link from 'next/link' import { useParams } from 'common' import ClientLibrary from 'components/interfaces/Home/ClientLibrary' import { ExampleProject } from 'components/interfaces/Home/ExampleProject' import { EXAMPLE_PROJECTS } from 'components/interfaces/Home/Home.constants' import { DisplayApiSettings, DisplayConfigSettings } from 'components/ui/ProjectSettings' import { invalidateProjectDetailsQuery } from 'data/projects/project-detail-query' import { useProjectStatusQuery } from 'data/projects/project-status-query' import { invalidateProjectsQuery } from 'data/projects/projects-query' import { useCustomContent } from 'hooks/custom-content/useCustomContent' import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled' import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject' import { DOCS_URL, PROJECT_STATUS } from 'lib/constants' import { Badge, Button } from 'ui' const BuildingState = () => { const { ref } = useParams() const { data: project } = useSelectedProjectQuery() const queryClient = useQueryClient() const showExamples = useIsFeatureEnabled('project_homepage:show_examples') const { projectHomepageClientLibraries: clientLibraries } = useCustomContent([ 'project_homepage:client_libraries', ]) useProjectStatusQuery( { projectRef: ref }, { enabled: project?.status !== PROJECT_STATUS.ACTIVE_HEALTHY, refetchInterval: (res) => { return res?.status === PROJECT_STATUS.ACTIVE_HEALTHY ? false : 4000 }, onSuccess: async (res) => { if (res.status === PROJECT_STATUS.ACTIVE_HEALTHY) { if (ref) invalidateProjectDetailsQuery(queryClient, ref) invalidateProjectsQuery(queryClient) } }, } ) if (project === undefined) return null return (

{project?.name}

{project.status === PROJECT_STATUS.UNKNOWN ? 'Initiating project set up' : 'Setting up project'}

{' '} We are provisioning your database and API endpoints

This may take a few minutes

While you wait

Browse the Supabase{' '} documentation .

} />

Not working?

Try refreshing after a couple of minutes.

} />

    If your dashboard hasn't connected within 2 minutes, you can open a support ticket.

    } />
{project.status === PROJECT_STATUS.COMING_UP && (

Client libraries

{clientLibraries!.map((library) => ( ))}
{showExamples && (
Example projects
{EXAMPLE_PROJECTS.map((project) => ( ))}
)}
)}
) } export default BuildingState const ChecklistItem = ({ description }: any) => { return (
  • {description}
  • ) }