This recipe explores an effective strategy for selecting the best logo to display in company listing apps, such as those used in fintech and other industries.
const icon = brand.logos.find(({ type }) => type === 'icon')
const logoDark = brand.logos.find(({ type, theme }) => type === 'logo' && theme === 'dark')
const logoLight = brand.logos.find(({ type, theme }) => type === 'logo' && theme === 'light')
const symbolDark = brand.logos.find(({ type, theme }) => type === 'logo' && theme === 'dark')
const symbolLight = brand.logos.find(({ type, theme }) => type === 'logo' && theme === 'light')
const file = logo.formats.find(({ format }) => format === 'svg')
const priorityList = ['svg', 'webp', 'png', 'jpeg', 'jpg'] const file = priorityList.find(priorityFormat => logo.formats.some(({ format }) => format === priorityFormat) )