/ resources / views / components / documents / document-info.blade.php
document-info.blade.php
 1  @props(['document'])
 2  
 3  <div class="flex flex-col w-full p-4 space-y-4 rounded shadow bg-gray-50">
 4      <div class="flex flex-col space-y-2">
 5          <h2 class="text-xl font-semibold text-gray-800">{{ $document->head->name }}</h2>
 6          <span class="self-start px-3 py-1 text-sm font-medium rounded-full {{ $document->isDraft() ? 'bg-yellow-100 text-yellow-800' : 'bg-green-100 text-green-800' }}">
 7              {{ $document->isDraft() ? __('documents.status.draft') : __('documents.status.published') }}
 8          </span>
 9          <div class="flex items-center space-x-2">
10              <svg class="w-5 h-5 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
11                  <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" />
12              </svg>
13              <span class="text-sm font-medium text-gray-500">{{ $document->name }}</span>
14          </div>
15      </div>
16  
17      <div class="grid grid-cols-1 gap-4 md:grid-cols-2">
18          <div class="space-y-2">
19              <div class="flex items-start space-x-2">
20                  <svg class="w-5 h-5 mt-1 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
21                      <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
22                  </svg>
23                  <div>
24                      <p class="text-sm font-medium text-gray-500">{{ __('documents.panel.fields.type') }}</p>
25                      <p class="text-gray-700">{{ read_mimetype($document->head->path) }}</p>
26                  </div>
27              </div>
28          </div>
29  
30          <div class="space-y-2">
31              <div class="flex items-start space-x-2">
32                  <svg class="w-5 h-5 mt-1 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
33                      <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
34                  </svg>
35                  <div>
36                      <p class="text-sm font-medium text-gray-500">{{ __('documents.panel.fields.description') }}</p>
37                      <p class="text-gray-700">{{ $document->head->description ?? __('documents.panel.no_description') }}</p>
38                  </div>
39              </div>
40          </div>
41      </div>
42  </div>