<!-- $o=Service\Phone::class -->

<div class="card">
	<x-ribbons.change :change="$o->service->is_pending_change"/>
	<x-ribbons.pending :pending="$o->service->is_pending_active"/>

	<div class="card-header bg-gray-dark">
		<h3 class="card-title">Phone Details</h3>
	</div>

	<div class="card-body bg-gray-dark">
		<table class="table table-sm">
			<tr>
				<th>Address</th>
				<td>{{ $o->service_address }}</td>
			</tr>
			<tr>
				<th>Service Number</th>
				<td>{{ $o->service_number }}</td>
			</tr>
			<tr>
				<th>Service Username</th>
				<td>{{ $o->service_username }}</td>
			</tr>
			<tr>
				<th>Service Password</th>
				<td>{{ $o->service_password }}</td>
			</tr>
			@if($o->connect_at)
				<tr>
					<th>Connected</th>
					<td>{{ $o->connect_at->format('Y-m-d') }}</td>
				</tr>
			@endif
			<!-- @todo -->
			@if($o->technology)
				<tr>
					<th>Technology</th>
					<td>{{ $o->technology }}</td>
				</tr>
			@endif
			<!-- @todo -->
			@if($o->service->product->type)
			<tr>
				<th>Usage</th>
				<td>{{ $o->service->product->type->allowance_string() }} Included Calls</td>
			</tr>
			@endif
			@if ($o->in_contract)
				<tr>
					<th>Contract</th>
					<td>{{ $o->contract_term }} months</td>
				</tr>
				<tr>
					<th>Contract End</th>
					<td>{{ $o->service_expire->format('Y-m-d') }} <small>({{ $o->service_expire->diffForHumans() }})</small></td>
				</tr>
			@endif
			<tr>
				<th>Cancel Notice</th>
				<td>1 month @if($o->in_contract)<small>(after {{ $o->service_expire->subMonth()->format('Y-m-d') }})</small>@endif</td>
			</tr>
		</table>
	</div>
</div>