pianello-api/resources/views/components/base/tippy/index.blade.php
Ale Gallo 96c0bfb8ce Committing laravel (part 5)
committing blade templating files and components that might come in handy
2023-11-10 16:41:20 +01:00

26 lines
872 B
PHP

@props(['as' => 'span', 'content' => null])
@if (substr($as, 0, 2) == 'x-')
<x-dynamic-component
title="{{ $content }}"
{{ $attributes->class(merge(['tooltip cursor-pointer', $attributes->whereStartsWith('class')->first()]))->merge($attributes->whereDoesntStartWith('class')->getAttributes()) }}
:component="substr($as, 2)"
>{{ $slot }}</x-dynamic-component>
@else
<{{ $as }}
title="{{ $content }}"
{{ $attributes->class(merge(['tooltip cursor-pointer', $attributes->whereStartsWith('class')->first()]))->merge($attributes->whereDoesntStartWith('class')->getAttributes()) }}
>{{ $slot }}</{{ $as }}>
@endif
@once
@push('vendors')
@vite('resources/js/vendor/tippy/index.js')
@endpush
@endonce
@once
@push('scripts')
@vite('resources/js/components/tippy/index.js')
@endpush
@endonce