import { type ComponentProps } from 'react' import { cn } from '@/lib' import logoDefault from '@/assets/negotium-logo.png' export type LogoVariant = 'color' | 'white' export type LogoSize = 'sm' | 'md' | 'lg' // 기본 브랜드(회사 설정 미지정 시). 회사 로고가 오면 logoUrl 이 이 값을 덮는다. const sources: Record = { color: logoDefault, white: logoDefault, } const sizes: Record = { sm: { img: 'h-6', text: 'text-base', gap: 'gap-1.5' }, md: { img: 'h-8', text: 'text-xl', gap: 'gap-2' }, lg: { img: 'h-10', text: 'text-2xl', gap: 'gap-2.5' }, } // 기본 브랜드 로고는 가로로 긴 워드마크라 같은 높이로 두면 회사 심볼보다 훨씬 커 보인다(랜딩도 h-4 기준). const wordmarkSizes: Record = { sm: 'h-3.5', md: 'h-4', lg: 'h-5', } export interface LogoProps extends Omit, 'children'> { variant?: LogoVariant size?: LogoSize withText?: boolean alt?: string /** 회사 브랜딩 오버라이드(companies.settings.branding). 없으면 기본 iMarket Korea. */ serviceName?: string logoUrl?: string } export function Logo({ variant = 'color', size = 'md', withText = true, alt = 'NEGOTIUM', serviceName, logoUrl, className, ...props }: LogoProps) { const s = sizes[size] const name = serviceName || 'negotium' return (
{withText {withText && serviceName && ( {name} )}
) } export default Logo