From d631c5cbdea1c45c5b2a989bf7ff9a1110ad38be Mon Sep 17 00:00:00 2001 From: Joe Fusco Date: Wed, 24 Jul 2024 14:23:05 -0400 Subject: [PATCH] Refactor defaults --- components/OpenGraph.jsx | 58 ++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/components/OpenGraph.jsx b/components/OpenGraph.jsx index a51227b..2364e8a 100644 --- a/components/OpenGraph.jsx +++ b/components/OpenGraph.jsx @@ -3,38 +3,38 @@ import Head from 'next/head' const OpenGraph = ({ seo } ) => { - const { - metaDesc = '', - opengraphDescription = '', - opengraphImage = null, - opengraphTitle = '', - opengraphType = '', - opengraphUrl = '', - title = '', - twitterDescription = '', - twitterTitle = '', - } = seo + const { + metaDesc = '', + opengraphDescription = '', + opengraphImage = { sourceUrl: '/default-og-image.jpg' }, + opengraphTitle = '', + opengraphType = 'website', + opengraphUrl = '', + title = '', + twitterDescription = '', + twitterTitle = '', + } = seo || {}; // Ensure seo is not null or undefined + - return ( - <> - - {title} - + return ( + <> + + {title} + - - - - - + + + + + - - - - - - - - ) + + + + + + + ) } OpenGraph.fragments = {