<x-head />
<x-header />
<section class="personal-cabinet">
    <div class="headtar">
        <p class="fontzag text-light fontre">Личный кабинет</p>
    </div>  
    <div class="blok border border-black">
        <p class="texttar sttext">Имя: {{ $subscriber->user->name }}</p>  
        <p class="texttar sttext">Номер: {{ $subscriber->number_phone }}</p>  
        <p class="texttar sttext">Почта: {{ $subscriber->user->email }}</p>  
        <p class="texttar sttext">Тариф: {{ $subscriber->trafic->name_trafic }}</p>
    </div>
    @if(Auth::user()->role == 'admin')
    <div class="blok border-black mt-4">
        <p class="texttar sttext">Создать новый тариф</p>
        <form action="{{ route('createtrafic') }}" method="post">
            @csrf
            <label for="name_trafic" class="form-label">Название тарифа</label>
            <input type="text" class="form-control" id="name_trafic" name="name_trafic">
            @error('name_trafic')
                 <div class="text-danger">{{ $message }}</div>
            @enderror
            <label for="price_second" class="form-label">Цена за секунду (рублей)</label>
            <input type="number" class="form-control" id="price_second" name="price_second">
            @error('price_second')
                 <div class="text-danger">{{ $message }}</div>
            @enderror
            <br>
            <button type="submit" class="btn btn-outline-dark" style="border-radius: 40px;">Создать тариф</button>
        </form>
    </div>
    @endif
</section>
<x-footer />