@props(['disabled' => false, 'witherrors' => false])

@php
$classes = ($witherrors && $errors->has($attributes->get('name')))
    ? 'block w-full text-sm text-red-500 border-red-300 dark:border-red-700 focus:border-red-500 dark:focus:border-red-600 focus:ring-red-500 dark:focus:ring-red-600 rounded-md shadow-sm file:mr-4 file:py-2 file:px-4 file:rounded-l-md file:border-0 file:text-sm file:font-semibold file:bg-red-50 dark:file:bg-red-800 file:text-red-700 dark:file:text-red-200 hover:file:bg-red-100 dark:hover:file:bg-red-700'
    : 'block w-full text-sm text-gray-500 dark:text-gray-400 border-gray-300 dark:border-gray-700 dark:bg-gray-900 focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 rounded-md shadow-sm file:mr-4 file:py-2 file:px-4 file:rounded-l-md file:border-0 file:text-sm file:font-semibold file:bg-gray-50 dark:file:bg-gray-700 file:text-gray-700 dark:file:text-gray-200 hover:file:bg-gray-100 dark:hover:file:bg-gray-600';
@endphp

<input type="file" {{ $disabled ? 'disabled' : '' }} {!! $attributes->merge(['class' => $classes]) !!}>