@props(['target'])
{{--
Inline upload progress for one `wire:model` file property.
Drop it next to any file input:
While a file is going up it shows the name, a percentage and a live bar
with a Cancel button; when it fails it shows why. It also takes over the
server-side validation message for the property, so a screen using this
component does not need a separate for the same field.
Registering ("claiming") the property here keeps quiet for
it, so an upload is never reported in two places at once.
--}}
merge(['class' => 'space-y-1.5']) }}
>
{{ __('Uploaded') }}
{{-- Anything the server rejected the file for, once the live state above has nothing to say. --}}
@php
// Multi-file properties report under "name.0", hence the wildcard fallback.
$uploadError = $errors->first($target) ?: $errors->first($target.'.*');
@endphp
@if ($uploadError)