import React from 'react' ; import '../header_logo.scss' ; import { ChromeBranding } from '../../../chrome_service' ; param { ChromeBranding } returns export const CustomLogo = ( { ... branding } ) => { const darkMode = branding . darkMode ; const assetFolderUrl = branding . assetFolderUrl ; const logoDefault = branding . logo ?. defaultUrl ; const logoDarkMode = branding . logo ?. darkModeUrl ; const markDefault = branding . mark ?. defaultUrl ; const markDarkMode = branding . mark ?. darkModeUrl ; const applicationTitle = branding . applicationTitle ; returns const customHeaderLogoDefaultMode = ( ) => { return logoDefault ?? markDefault ?? undefined ; } ; returns const customHeaderLogoDarkMode = ( ) => { return logoDarkMode ?? logoDefault ?? markDarkMode ?? markDefault ?? undefined ; } ; returns const customHeaderLogo = ( ) => { return darkMode ? customHeaderLogoDarkMode ( ) : customHeaderLogoDefaultMode ( ) ; } ; return customHeaderLogo ( ) ? ( < div className = "logoContainer" > < img data - test - subj = "customLogo" data - test - image - url = { customHeaderLogo ( ) } src = { customHeaderLogo ( ) } alt = { applicationTitle + ' logo' } loading = "lazy" className = "logoImage" / > < /div>) : (<img src={`${assetFolderUrl}/opensearch_logo . svg `} alt={applicationTitle + ' logo'}/>);
};
