{{!
  Copyright (c) HashiCorp, Inc.
  SPDX-License-Identifier: BUSL-1.1
~}}

<Breadcrumb @crumb={{hash label=this.model.name args=(array "administration.sentinel-policies.policy" this.model.name)}} />
{{page-title (concat "Sentinel Policy: " this.model.name)}}

<section class="section">
	<Hds::PageHeader class="variable-title" as |PH|>
		<PH.Title>{{this.model.name}}</PH.Title>
		{{#if (can "destroy sentinel-policy")}}
			<PH.Actions>
				<div>
					<TwoStepButton
						data-test-delete-policy
						@alignRight={{true}}
						@idleText="Delete Sentinel Policy"
						@cancelText="Cancel"
						@confirmText="Yes, Delete Policy"
						@confirmationMessage="Are you sure?"
						@awaitingConfirmation={{this.deletePolicy.isRunning}}
						@disabled={{this.deletePolicy.isRunning}}
						@onConfirm={{perform this.deletePolicy}}
					/>
				</div>
			</PH.Actions>
		{{/if}}
	</Hds::PageHeader>

	<SentinelPolicyEditor @policy={{this.model}} />
</section>
