/*
  icon-tile.tsx
  spboucher.ai Web
  Author: Simon-Pierre Boucher
  Mail: contact@spboucher.ai
*/

import type { LucideIcon } from "lucide-react";

import { cn } from "@/lib/utils";

const sizes = {
  sm: "h-8 w-8 rounded-[0.5rem] [&_svg]:h-3.5 [&_svg]:w-3.5",
  md: "h-10 w-10 rounded-[0.6rem] [&_svg]:h-4 [&_svg]:w-4",
  lg: "h-12 w-12 rounded-[0.7rem] [&_svg]:h-5 [&_svg]:w-5",
} as const;

interface IconTileProps {
  icon: LucideIcon;
  size?: keyof typeof sizes;
  className?: string;
}

/** A lucide icon set on a flat, hairline-ruled plate — quiet, editorial. */
export function IconTile({ icon: Icon, size = "md", className }: IconTileProps) {
  return (
    <span
      aria-hidden="true"
      className={cn(
        "inline-flex shrink-0 items-center justify-center border border-foreground/15 bg-card text-foreground/70 shadow-[var(--shadow-soft)]",
        sizes[size],
        className,
      )}
    >
      <Icon strokeWidth={1.5} />
    </span>
  );
}
