import React, { type HTMLAttributes, type SVGAttributes } from 'react' import classnames from 'classnames' import { type OverrideClassName } from '~components/types/OverrideClassName' import { assetUrl } from '~components/utils/hostedAssets' import { BrandCollectiveIntelligence } from './BrandCollectiveIntelligence' import styles from './Brand.module.css' type MeaningfulSVG = { 'role': 'img'; 'aria-label': string; 'alt'?: never } type DecorativeSVG = { 'role': 'presentation'; 'aria-label'?: never; 'alt'?: never } export type BrandSVGProps = OverrideClassName> & (MeaningfulSVG | DecorativeSVG) type SVGBackwardsCompatible = { role?: never; alt: string } type SVGProps = OverrideClassName> & (MeaningfulSVG | DecorativeSVG | SVGBackwardsCompatible) type VariantSVG = { variant: 'collective-intelligence' } & SVGProps type PictureProps = OverrideClassName> & { alt: string } type VariantPicture = { variant: 'logo-horizontal' | 'logo-vertical' | 'enso' } & PictureProps export type BrandProps = { reversed?: boolean } & (VariantSVG | VariantPicture) const isSVG = ( variant: VariantSVG['variant'] | VariantPicture['variant'], _restProps: SVGProps | PictureProps, ): _restProps is SVGProps => variant === 'collective-intelligence' export const Brand = ({ reversed = false, variant, ...restProps }: BrandProps): JSX.Element => { if (isSVG(variant, restProps)) { const { role, alt, 'aria-label': ariaLabel, ...props } = restProps if (role === 'presentation') { return } if (role === 'img') { return } return } const { alt, classNameOverride, style, ...otherProps } = restProps const brandTheme = reversed ? '-reversed' : '-default' return ( {alt} ) } Brand.displayName = 'Brand'