@props(['icon', 'class' => 'h-5 w-5', 'inverted' => true])

@php
    $allowed = [
        'applause',
        'chat',
        'close-breakout',
        'end',
        'leave',
        'lock',
        'personal',
        'panel',
        'raise-hand',
        'react',
        'schedule',
        'screen-share',
        'share',
        'start-breakout',
        'upload-file',
        'programme',
        'speak',
    ];
    $iconName = in_array($icon, $allowed, true) ? $icon : null;
    $iconPath = $iconName ? public_path('images/meet-icons/'.$iconName.'.svg') : null;
    $iconVer = ($iconPath && is_file($iconPath)) ? (@filemtime($iconPath) ?: '1') : '1';
    $iconClass = trim(($inverted ? 'meet-toolbar-icon ' : '').$class);
@endphp

@if ($iconName)
    <img src="{{ asset('images/meet-icons/'.$iconName.'.svg') }}?v={{ $iconVer }}" alt="" {{ $attributes->merge(['class' => $iconClass]) }}>
@endif
