ServiceList.tsx24 lines · main
1import { AlertCircle } from 'lucide-react'
2import { Alert, AlertTitle } from 'ui'
3
4import { PostgrestConfig } from './PostgrestConfig'
5import { ScaffoldSection } from '@/components/layouts/Scaffold'
6import { useSelectedProjectQuery } from '@/hooks/misc/useSelectedProject'
7import { PROJECT_STATUS } from '@/lib/constants'
8
9export const ServiceList = () => {
10 const { data: project, isPending: isLoading } = useSelectedProjectQuery()
11
12 return (
13 <ScaffoldSection isFullWidth id="api-settings" className="gap-6 py-0!">
14 {!isLoading && project?.status !== PROJECT_STATUS.ACTIVE_HEALTHY ? (
15 <Alert variant="destructive">
16 <AlertCircle size={16} />
17 <AlertTitle>API settings are unavailable as the project is not active</AlertTitle>
18 </Alert>
19 ) : (
20 <PostgrestConfig />
21 )}
22 </ScaffoldSection>
23 )
24}