@props([ 'title', // 'must'(赤・必ずやる)/ 'caution'(黄・注意)/ 'optional'(黄・必要な人だけ)/ 'info'(中立・ただの説明) 'variant' => 'info', // 既定は閉じる(説明を短く見せるため)。重要な節だけ open=true にできる。 'open' => false, ]) @php $sid = 'helpsec-'.\Illuminate\Support\Str::random(8); $variant = in_array($variant, ['must', 'caution', 'optional', 'info'], true) ? $variant : 'info'; $map = [ 'must' => [ 'badge' => '必ずやる', 'badgeClass' => 'bg-danger', 'wrapClass' => 'help-section-must', 'headClass' => 'text-danger', 'icon' => 'bi-exclamation-triangle-fill', ], 'caution' => [ 'badge' => '注意', 'badgeClass' => 'bg-warning text-dark', 'wrapClass' => 'help-section-optional', 'headClass' => 'text-warning-emphasis', 'icon' => 'bi-exclamation-circle-fill', ], 'optional' => [ 'badge' => '必要な人だけ', 'badgeClass' => 'bg-warning text-dark', 'wrapClass' => 'help-section-optional', 'headClass' => 'text-warning-emphasis', 'icon' => 'bi-info-circle-fill', ], 'info' => [ 'badge' => null, 'badgeClass' => '', 'wrapClass' => 'help-section-info', 'headClass' => 'text-body', 'icon' => 'bi-card-text', ], ]; $c = $map[$variant]; @endphp @once @push('head') @endpush @endonce
{{ $slot }}