@extends('layouts/base_view')
@section('title')
{!! $variables['header_routes'] !!}
@endsection
@section('content')
<section class="content">
    <div class="container-fluid">
        <div class="row">
            <div class="col-12">
                <div class="card card-outline card-warning">
                    <div class="card-header">
                        <h3 class="card-title">{{ $variables['judul'] }}</h3>
                        <div class="card-tools">
                            <a href="{{ route('sales_types.edit', $data->id) }}" class="btn btn-sm btn-warning button-cek-permission" data-permission="sales_types.edit">
                                <i class="fas fa-edit"></i> Ubah
                            </a>
                            <a href="{{ route('sales_types.index') }}" class="btn btn-sm btn-warning">
                                <i class="fas fa-arrow-left"></i> Kembali
                            </a>
                        </div>
                    </div>
                    <div class="card-body">
                        <div class="row">
                            <div class="col-lg-3 col-md-4 col-sm-6 mb-3">
                                <div class="form-group">
                                    <label class="font-weight-bold">Kode</label>
                                    <div class="mt-1">
                                        <span class="badge badge-info">{{ $data->code }}</span>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-3 col-md-4 col-sm-6 mb-3">
                                <div class="form-group">
                                    <label class="font-weight-bold">Nama</label>
                                    <div class="mt-1">{{ $data->name }}</div>
                                </div>
                            </div>
                            <div class="col-lg-3 col-md-4 col-sm-6 mb-3">
                                <div class="form-group">
                                    <label class="font-weight-bold">Status</label>
                                    <div class="mt-1">
                                        @if($data->is_active)
                                        <span class="badge badge-success">Aktif</span>
                                        @else
                                        <span class="badge badge-secondary">Nonaktif</span>
                                        @endif
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-3 col-md-4 col-sm-6 mb-3">
                                <div class="form-group">
                                    <label class="font-weight-bold">Dibuat Oleh</label>
                                    <div class="mt-1">
                                        <small class="text-muted">
                                            {{ $data->creator->fullname ?? 'System' }}<br>
                                            {{ $data->created_at->format('d M Y, H:i') }}
                                        </small>
                                    </div>
                                </div>
                            </div>
                            @if($data->modificator)
                            <div class="col-lg-3 col-md-4 col-sm-6 mb-3">
                                <div class="form-group">
                                    <label class="font-weight-bold">Diubah Oleh</label>
                                    <div class="mt-1">
                                        <small class="text-muted">
                                            {{ $data->modificator->fullname }}<br>
                                            {{ $data->updated_at->format('d M Y, H:i') }}
                                        </small>
                                    </div>
                                </div>
                            </div>
                            @endif
                            @if($data->description)
                            <div class="col-12 mb-3">
                                <div class="form-group">
                                    <label class="font-weight-bold">Deskripsi</label>
                                    <div class="mt-1">{{ $data->description }}</div>
                                </div>
                            </div>
                            @endif
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
@endsection