<x-daylight::tables.row wire:key="{{ $row->id }}" :$row>
    <x-daylight::tables.column class="flex items-center">
        <a href="{{ route('daylight.store.categories.edit', $row) }}" style="margin-left: {{ $level * 16 }}px">
            {{ $row->name }}
        </a>
    </x-daylight::tables.column>

    <x-daylight::tables.column>
        {{ $row->created_at->isoFormat('LLL') }}
    </x-daylight::tables.column>

    <x-slot:actions>
        <div class="flex items-center justify-end gap-1">
            @if(\Illuminate\Support\Facades\Route::has(app()->getLocale() . '_products.category'))
                <a href="{{ route(app()->getLocale() . '_products.category', ['any' => $row->translations->first()->nested_slug]) }}"
                   class="py-0.5 pl-2 pr-1 inline-flex font-medium items-center gap-1 text-sm text-gray-600 hover:text-gray-900">
                    <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4">
                        <path stroke-linecap="round" stroke-linejoin="round" d="M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z" />
                        <path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" />
                    </svg>
                </a>
            @endif
            <x-daylight::tables.row-actions
                :edit-url="route('daylight.store.categories.edit', $row)"
                :can-duplicate="false"
                :can-delete="true"
                :row-id="$row->id"
            />
        </div>
    </x-slot:actions>
</x-daylight::tables.row>

@if($row->children->isNotEmpty())
    @foreach($row->children as $child)
        @include('daylight::store.categories.partials.category', ['row' => $child, 'level' => $level + 1])
    @endforeach
@endif
