@if($showModal)

@if($taskId) Edit {{ $isSubtask ? 'Subtask' : 'Task' }} @else Add {{ $isSubtask ? 'Subtask' : 'Task' }} @endif

@error('title') {{ $message }} @enderror
@error('description') {{ $message }} @enderror
@if(!$isSubtask)
@error('category_id') {{ $message }} @enderror
@endif
@foreach($employees as $userId => $userName) @endforeach
@error('assigned_to') {{ $message }} @enderror
@error('priority') {{ $message }} @enderror
@error('status') {{ $message }} @enderror
@error('due_date') {{ $message }} @enderror
@if($taskId)

Notes ({{ count($notes) }})

@forelse($notes as $note)

{{ $note['content'] }}

{{ $note['user']['name'] ?? 'Unknown' }} • {{ \Carbon\Carbon::parse($note['created_at'])->diffForHumans() }}

@empty

No notes yet

@endforelse

Attachments ({{ count($attachments) }})

Uploading...
@forelse($attachments as $attachment)
@if(str_starts_with($attachment['file_type'] ?? '', 'image/')) {{ $attachment['file_name'] }} @else
@endif
{{ $attachment['file_name'] }}

{{ $attachment['user']['name'] ?? 'Unknown' }} • {{ \Carbon\Carbon::parse($attachment['created_at'])->diffForHumans() }}

@empty

No attachments yet

@endforelse
@else

Save the task first to add notes and attachments

@endif
@endif