@aptly-as/types
Version:
Aptly types and enums
23 lines (22 loc) • 755 B
JavaScript
export function useAptlyLogoSrc(content) {
let src = '';
if (content.project && 'theme' in content.project) {
if (content.project.theme?.images) {
if (content.project.theme.images.logoMedia) {
src = content.project.theme.images.logoMedia.src;
}
else if (content.project.theme.images.logo) {
src = content.project.theme.images.logo;
}
}
}
if (!src && content.organization && 'name' in content.organization) {
if (content.organization.logoMedia) {
src = content.organization.logoMedia.src;
}
else if (content.organization.logo) {
src = content.organization.logo;
}
}
return src;
}