@extends('layouts.admin')
@section('styles')
@endsection
@section('app')
    <div class="container-fluid">
        <div class="list-product-header">
            <div>
                <a class="btn btn-dark" href="{{ route('master.services') }}">Kembali</a>
            </div>
        </div>
        <div class="card">
            <div class="card-body">
                <form class="row g-3 custom-input" action="{{ route('master.service.update', encryptId($service->id)) }}"
                    method="post">
                    @csrf
                    @method('put')
                    <div class="col-lg-6 position-relative">
                        <label class="form-label" for="name">Nama</label>
                        <input name="name" class="form-control @error('name') is-invalid @enderror" id="name"
                            type="text" placeholder="Masukan Nama" value="{{ old('name', $service->name) }}">
                        @error('name')
                            <div class="invalid-feedback">
                                {{ $message }}
                            </div>
                        @enderror
                    </div>
                    <div class="col-lg-6 position-relative">
                        <label class="form-label" for="price">Harga</label>
                        <input name="price" class="form-control rupiah-format @error('price') is-invalid @enderror"
                            id="price" type="text" placeholder="Masukan Harga"
                            value="{{ old('price', formatToRupiah($service->price)) }}" inputmode="numeric">
                        @error('price')
                            <div class="invalid-feedback">
                                {{ $message }}
                            </div>
                        @enderror
                    </div>
                    <div class="col-lg-12 position-relative">
                        <label class="form-label" for="description">Deskripsi</label>
                        <textarea name="description" class="form-control @error('description') is-invalid @enderror" id="description"
                            rows="3" placeholder="Masukan Deskripsi">{{ old('description', $service->description) }}</textarea>
                        @error('description')
                            <div class="invalid-feedback">
                                {{ $message }}
                            </div>
                        @enderror
                    </div>
                    <div class="col-12">
                        <button class="btn btn-primary button-disable" type="submit">Simpan</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
@endsection
@section('afterScripts')
    <script src="{{ asset('assets/js/forms/button-disable.js?ver=1.0.0') }}"></script>
    <script src="{{ asset('assets/js/forms/rupiah-format.js?ver=1.0.0') }}"></script>
@endsection
