{{ define "repo/pulls/fragments/diffSettings" }}
{{ $diffUrl := .DiffUrl }}
{{ $unified := .Unified }}
<div class="btn-group">
  <button
    type="button"
    hx-get="{{ $diffUrl }}"
    hx-vals='{"view": "unified"}'
    hx-target="#diff-list"
    hx-swap="outerHTML"
    class="group btn-group-item {{ if $unified }}active{{ end }}"
  >
    <span class="inline group-[.htmx-request]:hidden">{{ i "square-split-vertical" "size-4" }}</span>
    <span class="hidden group-[.htmx-request]:inline animate-spin">{{ i "loader-circle" "size-4" }}</span>
    Unified
  </button>
  <button
    type="button"
    hx-get="{{ $diffUrl }}"
    hx-target="#diff-list"
    hx-swap="outerHTML"
    class="group btn-group-item {{ if not $unified }}active{{ end }}"
  >
    <span class="inline group-[.htmx-request]:hidden">{{ i "square-split-horizontal" "size-4" }}</span>
    <span class="hidden group-[.htmx-request]:inline animate-spin">{{ i "loader-circle" "size-4" }}</span>
    Split
  </button>
</div>
{{ end }}
