(cat)
| 42 | }, [id]); |
| 43 | |
| 44 | const categoryImage = (cat) => { |
| 45 | const imgSrc = images.find(image => image.category === cat); |
| 46 | if (imgSrc) { |
| 47 | return imgSrc.src; |
| 48 | } |
| 49 | return '' // Safeguard for undefined |
| 50 | }; |
| 51 | |
| 52 | if (!blogPost) return <div>Loading...</div>; |
| 53 |