<!-- #region GitOperationsPanel [C:2] [TYPE Component] [SEMANTICS git, operations, pull, push, deploy] -->
<!-- @ingroup Components -->
<!-- @BRIEF Git server operations panel: pull, push, and deploy actions. -->
<!-- @LAYER UI -->
<script lang="ts">
  import { Button } from "$lib/ui";

  let {
    isPulling,
    isPushing,
    workspaceStatus,
    currentEnvStage,
    onPull,
    onPush,
    onDeploy,
  } = $props();
</script>

<div class="grid grid-cols-1 gap-3 md:grid-cols-3">
  <Button
    variant="ghost"
    onclick={onPull}
    disabled={isPulling}
    isLoading={isPulling}
    class="border border-border"
  >
    ⬇ Pull
  </Button>
  <Button
    variant="ghost"
    onclick={onPush}
    disabled={isPushing}
    isLoading={isPushing}
    class="border border-border"
  >
    ⬆ Push{#if workspaceStatus?.ahead_count > 0} ({workspaceStatus.ahead_count}){/if}
  </Button>
  <Button
    variant="primary"
    onclick={onDeploy}
    class={`w-full ${currentEnvStage === 'PROD' ? 'bg-destructive hover:bg-destructive-hover focus-visible:ring-destructive-ring' : 'bg-success hover:bg-success focus-visible:ring-success-ring'}`}
  >
    🚀 Deploy
  </Button>
</div>
<!-- #endregion GitOperationsPanel -->
