diff --git a/packages/frontend/src/components/projects/project/deployments/DeploymentDetailsCard.tsx b/packages/frontend/src/components/projects/project/deployments/DeploymentDetailsCard.tsx index c4940bac..09bfe11c 100644 --- a/packages/frontend/src/components/projects/project/deployments/DeploymentDetailsCard.tsx +++ b/packages/frontend/src/components/projects/project/deployments/DeploymentDetailsCard.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useCallback } from 'react'; import { Deployment, DeploymentStatus, @@ -60,79 +60,97 @@ const DeploymentDetailsCard = ({ } }; - return ( -
-
- {/* DEPLOYMENT URL */} - {deployment.url && ( - { + return ( +
+ - - {deployment.url} - - - )} - - {deployment.environment === Environment.Production - ? `Production ${deployment.isCurrent ? '(Current)' : ''}` - : 'Preview'} - + {deployment.status} + +
+ ); + }, + [deployment.status, deployment.commitHash], + ); + + return ( +
+
+
+ {/* DEPLOYMENT URL */} + {deployment.url && ( + + + {deployment.url} + + + )} + + {deployment.environment === Environment.Production + ? `Production ${deployment.isCurrent ? '(Current)' : ''}` + : 'Preview'} + +
{/* DEPLOYMENT STATUS */} -
- - {deployment.status} - -
+ {renderDeploymentStatus('w-[10%] max-w-[110px] hidden md:flex h-fit')} {/* DEPLOYMENT COMMIT DETAILS */} -
- - - {deployment.branch} - - - - - {deployment.commitHash.substring(0, SHORT_COMMIT_HASH_LENGTH)}{' '} - {deployment.commitMessage} - - +
+
+ + + + {deployment.branch} + + + + + + {deployment.commitHash.substring(0, SHORT_COMMIT_HASH_LENGTH)}{' '} + {deployment.commitMessage} + + +
+ {renderDeploymentStatus('flex md:hidden h-fit')}
{/* DEPLOYMENT INFOs */} -
-
- - - {relativeTimeMs(deployment.createdAt)} - -
- +
+
+
+ + + {relativeTimeMs(deployment.createdAt)} + +
+
+
+ +
+ + {formatAddress(deployment.createdBy.name ?? '')} +
- - - {formatAddress(deployment.createdBy.name ?? '')} -
{ }; return ( -
+