vernova/resources/views/inventory/show.blade.php
2026-07-26 19:58:27 +03:30

77 lines
4.0 KiB
PHP

@extends('layouts.app')
@section('title', $item->name)
@section('content')
<div class="space-y-6">
<!-- Page Header -->
<div class="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
<div class="flex items-center gap-3">
<a href="{{ route('inventory.items') }}" class="p-2 text-gray-500 hover:text-gray-900 hover:bg-gray-100 rounded-lg transition-colors">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18"/></svg>
</a>
<div>
<h1 class="text-2xl font-bold text-gray-900">{{ $item->name }}</h1>
<p class="text-sm text-gray-500">{{ $item->code }}</p>
</div>
</div>
<div class="flex items-center gap-2">
<a href="{{ route('inventory.edit', $item) }}" class="px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors">
{{ __('common.edit') }}
</a>
<form method="POST" action="{{ route('inventory.destroy', $item) }}" class="inline" onsubmit="return confirm('{{ __('common.confirm_delete') }}')">
@csrf @method('DELETE')
<button type="submit" class="px-4 py-2 text-sm font-medium text-red-700 bg-red-50 border border-red-200 rounded-lg hover:bg-red-100 transition-colors">
{{ __('common.delete') }}
</button>
</form>
</div>
</div>
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
<!-- Main Info -->
<div class="lg:col-span-2">
<div class="bg-white rounded-xl border border-gray-200 p-6">
<div class="grid grid-cols-2 gap-4">
<div>
<p class="text-xs text-gray-500">{{ __('inventory.code') }}</p>
<p class="text-sm font-medium text-gray-900 mt-1">{{ $item->code ?? '-' }}</p>
</div>
<div>
<p class="text-xs text-gray-500">{{ __('inventory.category') }}</p>
@if($item->category)
@php
$ck = 'inventory.category_' . $item->category;
$cl = __($ck);
if ($cl === $ck) $cl = $item->category;
@endphp
<p class="text-sm font-medium text-gray-900 mt-1">{{ $cl }}</p>
@else
<p class="text-sm font-medium text-gray-900 mt-1">-</p>
@endif
</div>
<div>
<p class="text-xs text-gray-500">{{ __('inventory.unit') }}</p>
<p class="text-sm font-medium text-gray-900 mt-1">{{ $item->unit ?? '-' }}</p>
</div>
<div>
<p class="text-xs text-gray-500">{{ __('common.status') }}</p>
@if($item->is_active)
<span class="inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium mt-1 bg-emerald-50 text-emerald-700">{{ __('common.active') }}</span>
@else
<span class="inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium mt-1 bg-gray-100 text-gray-600">{{ __('common.inactive') }}</span>
@endif
</div>
</div>
@if($item->description)
<div class="mt-4 pt-4 border-t border-gray-100">
<p class="text-xs text-gray-500 mb-1">{{ __('common.description') }}</p>
<p class="text-sm text-gray-700">{{ $item->description }}</p>
</div>
@endif
</div>
</div>
</div>
</div>
@endsection