<h2>{{ (isEditMode() ? 'basic.edit' : 'basic.new') | translate }} {{ 'model.shipping_company' | translate }}</h2>
<div class="spt-form">
    <form [formGroup]="form" (ngSubmit)="onSubmit()">
        <div class="mb-3">
            <label for="name" class="form-label">{{ 'common.name' | translate }}*:</label>
            <input type="text"
                   class="form-control"
                   id="name"
                   formControlName="name"
                   required/>
        </div>

        <div class="mb-3">
            <label for="code" class="form-label">{{ 'common.code' | translate }}*:</label>
            <input type="text"
                   class="form-control"
                   id="code"
                   formControlName="code"
                   required/>
        </div>

        <div class="flex gap-2">
            <button type="submit" class="btn btn-primary" [disabled]="form.invalid">
                {{ 'basic.save' | translate }}
            </button>

            @if (isEditMode()) {
                <button type="button" class="spt-button spt-button-danger" (click)="onDelete()">
                    {{ 'basic.delete' | translate }} {{ 'model.shipping_company' | translate }}
                </button>
            }
        </div>
    </form>
</div>