{project?.name ?? $t('common.project')} - {$t('app.name')} {#if loading}
{#each Array(4) as _} {/each}
{:else if error}

{error}

{:else if project}

{project.name}

{project.image}

{$t('projectDetail.envVars')} {$t('projectDetail.volumes')}
{#if editing}
{:else}

{$t('projects.port')}

{project.port || 'Auto'}

{$t('projects.healthcheck')}

{project.healthcheck || 'Auto'}

{$t('projects.registry')}

{project.registry || '-'}

{$t('projects.created')}

{new Date(project.created_at).toLocaleDateString()}

{/if}

{$t('projectDetail.stages')}

{#if showAddStage}
{/if} {#if stages.length === 0 && !showAddStage}
{:else}
{#each stages as stage (stage.id)} {@const stageInstances = instancesByStage[stage.id] ?? []}

{stage.name}

{stage.tag_pattern} {#if stage.auto_deploy} {$t('projectDetail.autoDeploy')} {/if} {#if stage.confirm} {$t('projectDetail.requiresConfirm')} {/if} {#if !stage.enable_proxy} {$t('projectDetail.noProxy')} {/if}
{stageInstances.length} / {stage.max_instances} {$t('projectDetail.instances')}
{#if deployStageId === stage.id}
{#if tagsLoading}
{$t('projectDetail.loadingTags')}
{:else if availableTags.length > 0} {:else} {/if}
{#if deployError}

{deployError}

{/if}
{/if}
{#if stageInstances.length === 0}

{$t('projectDetail.noInstancesRunning')}

{:else}
{#each stageInstances as instance (instance.id)} {/each}
{/if}
{/each}
{/if}

{$t('projectDetail.recentDeploys')}

{#if deploys.length === 0}

{$t('projectDetail.noDeployHistory')}

{:else}
{#each deploys as deploy (deploy.id)}
{deploy.image_tag}
{#if deploy.started_at} {new Date(deploy.started_at).toLocaleString()} {/if} {#if deploy.finished_at} → {new Date(deploy.finished_at).toLocaleString()} {/if}
{#if deploy.error}

{deploy.error}

{/if}
{/each}
{/if}
{ showDeleteConfirm = false; }} /> {/if}