import { Github } from 'lucide-react' import { useRouter } from 'next/router' import InlineSVG from 'react-inlinesvg' import { ComputeBadgeWrapper } from 'components/ui/ComputeBadgeWrapper' import type { IntegrationProjectConnection } from 'data/integrations/integrations.types' import { getComputeSize, OrgProject } from 'data/projects/org-projects-infinite-query' import type { ResourceWarning } from 'data/usage/resource-warnings-query' import { BASE_PATH } from 'lib/constants' import { createNavigationHandler } from 'lib/navigation' import type { Organization } from 'types' import { TableCell, TableRow } from 'ui' import { TimestampInfo } from 'ui-patterns' import { inferProjectStatus } from './ProjectCard.utils' import { ProjectCardStatus } from './ProjectCardStatus' export interface ProjectTableRowProps { project: OrgProject organization?: Organization rewriteHref?: string githubIntegration?: IntegrationProjectConnection vercelIntegration?: IntegrationProjectConnection resourceWarnings?: ResourceWarning } export const ProjectTableRow = ({ project, organization, rewriteHref, githubIntegration, vercelIntegration, resourceWarnings, }: ProjectTableRowProps) => { const router = useRouter() const { name, ref: projectRef } = project const projectStatus = inferProjectStatus(project.status) const url = rewriteHref ?? `/project/${project.ref}` const isGithubIntegrated = githubIntegration !== undefined const isVercelIntegrated = vercelIntegration !== undefined const githubRepository = githubIntegration?.metadata.name ?? undefined const infraInformation = project.databases.find((x) => x.identifier === project.ref) const handleNavigation = createNavigationHandler(url, router) return (
{/* Text */}
{name}

ID: {projectRef}

{/* Integrations */} {(isGithubIntegrated || isVercelIntegrated) && (
{isVercelIntegrated && (
)} {isGithubIntegrated && (
{githubRepository && (

{githubRepository}

)}
)}
)}
{project.status !== 'INACTIVE' ? ( ) : ( )}
{project.cloud_provider} | {project.region || 'N/A'} {project.inserted_at ? ( ) : ( N/A )}
) }