---
/**
 * Icônes SVG inline — style fine-line 1.5px, conformes au DESIGN.md.
 * Remplacent la police Material Symbols utilisée dans les maquettes (interdite en prod).
 */
export interface Props {
  name:
    | 'menu'
    | 'close'
    | 'arrow-right'
    | 'star'
    | 'instagram'
    | 'mail'
    | 'phone'
    | 'pin'
    | 'florist'
    | 'craft'
    | 'leaf'
    | 'share';
  class?: string;
  size?: number;
  'aria-label'?: string;
}

const { name, class: className = '', size = 24, 'aria-label': ariaLabel } = Astro.props;
const a11y = ariaLabel
  ? { role: 'img', 'aria-label': ariaLabel }
  : { 'aria-hidden': 'true', focusable: 'false' };
---

{name === 'menu' && (
  <svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class={className} {...a11y}>
    <path d="M3 6h18M3 12h18M3 18h18" />
  </svg>
)}

{name === 'close' && (
  <svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class={className} {...a11y}>
    <path d="M6 6l12 12M6 18L18 6" />
  </svg>
)}

{name === 'arrow-right' && (
  <svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class={className} {...a11y}>
    <path d="M5 12h14M13 5l7 7-7 7" />
  </svg>
)}

{name === 'star' && (
  <svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 24 24" fill="currentColor" class={className} {...a11y}>
    <path d="M12 2.5l2.95 6.32 6.55.7-4.95 4.6 1.4 6.5L12 17.3 6.05 20.62l1.4-6.5L2.5 9.52l6.55-.7L12 2.5z" />
  </svg>
)}

{name === 'instagram' && (
  <svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class={className} {...a11y}>
    <rect x="3" y="3" width="18" height="18" rx="5" />
    <circle cx="12" cy="12" r="4" />
    <circle cx="17.5" cy="6.5" r="0.6" fill="currentColor" />
  </svg>
)}

{name === 'mail' && (
  <svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class={className} {...a11y}>
    <rect x="3" y="5" width="18" height="14" rx="1.5" />
    <path d="M3.5 6.5l8.5 6.5 8.5-6.5" />
  </svg>
)}

{name === 'phone' && (
  <svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class={className} {...a11y}>
    <path d="M5 4h3l2 5-2.5 1.5a11 11 0 005.5 5.5l1.5-2.5L20 16v3a2 2 0 01-2 2A16 16 0 013 6a2 2 0 012-2z" />
  </svg>
)}

{name === 'pin' && (
  <svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class={className} {...a11y}>
    <path d="M12 22s7-7.5 7-13a7 7 0 10-14 0c0 5.5 7 13 7 13z" />
    <circle cx="12" cy="9" r="2.5" />
  </svg>
)}

{name === 'florist' && (
  <svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class={className} {...a11y}>
    <circle cx="12" cy="8" r="2.5" />
    <path d="M12 5.5C11 3 8 3 7 5s.5 4 3 4M12 5.5C13 3 16 3 17 5s-.5 4-3 4M9.5 9.5C7 10.5 6 13 7.5 14.5s4 1 5-1.5M14.5 9.5C17 10.5 18 13 16.5 14.5s-4 1-5-1.5M12 13v9" />
  </svg>
)}

{name === 'craft' && (
  <svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class={className} {...a11y}>
    <path d="M3 21l4-4M7 17l5-5M12 12l3-3 6 6-3 3-6-6zM9 7l4-4 3 3-4 4" />
  </svg>
)}

{name === 'leaf' && (
  <svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class={className} {...a11y}>
    <path d="M5 19c0-9 6-14 15-14 0 9-6 14-15 14zM5 19c1-5 4-8 9-10" />
  </svg>
)}

{name === 'share' && (
  <svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class={className} {...a11y}>
    <circle cx="6" cy="12" r="2.5" />
    <circle cx="18" cy="6" r="2.5" />
    <circle cx="18" cy="18" r="2.5" />
    <path d="M8 11l8-4M8 13l8 4" />
  </svg>
)}
