@props(['name'])
@php
// Lucide (https://lucide.dev) path bodies — trusted, static markup.
$icons = [
'gauge' => '',
'cloud' => '',
'users' => '',
'database' => '',
'receipt' => '',
'life-buoy' => '',
'menu' => '',
'log-out' => '',
'chevron-down' => '',
'external-link'=> '',
'shield-check' => '',
'shield' => '',
'pen' => '',
'download' => '',
'alert-triangle' => '',
'check' => '',
'refresh' => '',
'bell' => '',
'calendar' => '',
'qr-code' => '',
'lock' => '',
'unlock' => '',
'copy' => '',
'x' => '',
'plus' => '',
'server' => '',
'activity' => '',
'trending-up' => '',
'box' => '',
'bell' => '',
'arrow-left' => '',
'tag' => '',
'rotate-ccw' => '',
'trash-2' => '',
'settings' => '',
];
$body = $icons[$name] ?? '';
// The default size applies only when the caller has not chosen one.
//
// Merging `size-5` unconditionally does NOT lose to a caller's `size-4`:
// both utilities have the same specificity, so stylesheet order decides,
// and Tailwind emits `.size-4` before `.size-5`. Every icon written as
// size-4 was therefore rendering at 20px — visibly too large, and against
// whatever the call site asked for.
$sized = preg_match('/(^|\s)(size|[hw])-\S/', (string) $attributes->get('class', '')) === 1;
@endphp
{{--
inline-block, not the block that Tailwind's preflight gives an svg: a block
icon inside an inline parent pushes the text that follows it onto a second
line. In a flex or grid parent this changes nothing (items are blockified
there), so it is a safety net that costs nothing. shrink-0 for the matching
reason: an icon must never be squashed by a long label beside it.
--}}