()
| 64 | }; |
| 65 | |
| 66 | const fetchData = async () => { |
| 67 | try { |
| 68 | let response = await fetch(`${VITE_SERVER_PORT}/api/blog/all-blog`); |
| 69 | let data = await response.json(); |
| 70 | setBlogPosts(data.blogs); |
| 71 | console.log(data.blogs); |
| 72 | } catch (error) { |
| 73 | console.error(error); |
| 74 | } |
| 75 | }; |
| 76 | |
| 77 | const handlePlay = (id, title, excerpt) => { |
| 78 | const textToSpeak = `${title}. ${excerpt}`; |