ServiceList.tsx 859 B

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