import { FileText, Sparkles } from 'lucide-react';

export type AppIconKind = 'report' | 'plan';
export type AppIconVariant = 'inline' | 'circled';

interface AppIconProps {
  kind: AppIconKind;
  variant?: AppIconVariant;
  size?: number;
  className?: string;
}

const ICON_MAP = {
  report: FileText,
  plan: Sparkles,
} as const;

const CIRCLE_TINT: Record<AppIconKind, string> = {
  report: 'bg-brand-tint-purple text-brand-purple',
  plan: 'bg-brand-tint-lavender text-brand-purple',
};

export function AppIcon({ kind, variant = 'inline', size = 12, className }: AppIconProps) {
  const Icon = ICON_MAP[kind];

  if (variant === 'circled') {
    const boxSize = size * 2;
    return (
      <span
        className={`inline-flex items-center justify-center rounded-full ${CIRCLE_TINT[kind]} ${className ?? ''}`}
        style={{ width: boxSize, height: boxSize }}
      >
        <Icon size={size} />
      </span>
    );
  }

  return <Icon size={size} className={className} />;
}
