({
squad,
}: {
squad?: Pick<Source, 'id' | 'image' | 'public'>;
})
| 89 | }; |
| 90 | |
| 91 | export const getSquadOpenGraph = ({ |
| 92 | squad, |
| 93 | }: { |
| 94 | squad?: Pick<Source, 'id' | 'image' | 'public'>; |
| 95 | }): Partial<OpenGraph> => { |
| 96 | // The share card is screenshotted from an anonymous render, which can only |
| 97 | // read public squads — private ones keep the plain image behavior. |
| 98 | if (squad?.id && squad.public) { |
| 99 | return { |
| 100 | images: [ |
| 101 | { url: getShareImageUrl('squads', squad.id), width: 1200, height: 630 }, |
| 102 | ], |
| 103 | }; |
| 104 | } |
| 105 | |
| 106 | return { |
| 107 | images: |
| 108 | squad?.image && squad.image !== cloudinarySquadsImageFallback |
| 109 | ? [{ url: squad.image }] |
| 110 | : defaultOpenGraph.images, |
| 111 | }; |
| 112 | }; |
| 113 | |
| 114 | // Canonical marketing tagline. Static surfaces that can't import this TS |
| 115 | // constant keep their own copy — the extension locale JSON |
no test coverage detected