import { RESOURCE_TYPE_STYLES } from './resource-types'
import type { ResourceType } from '@/domain/types'

export function ResourceTypeAvatar({ type, size = 32 }: { type: ResourceType; size?: number }) {
  const { icon: Icon, bg, fg } = RESOURCE_TYPE_STYLES[type]
  return (
    <div
      className="flex items-center justify-center rounded-full flex-shrink-0"
      style={{ width: size, height: size, background: bg }}
    >
      <Icon style={{ color: fg, width: size * 0.55, height: size * 0.55 }} />
    </div>
  )
}
