()
| 29 | |
| 30 | useEffect(() => { |
| 31 | async function fetchVersion() { |
| 32 | try { |
| 33 | const res = await fetch( |
| 34 | "https://raw.githubusercontent.com/CodeGraphContext/CodeGraphContext/main/README.md" |
| 35 | ); |
| 36 | if (!res.ok) throw new Error("Failed to fetch README"); |
| 37 | const text = await res.text(); |
| 38 | const match = text.match(/\*\*Version:\*\*\s*([0-9]+\.[0-9]+\.[0-9]+)/i); |
| 39 | setVersion(match ? match[1] : "N/A"); |
| 40 | } catch (err) { |
| 41 | setVersion("N/A"); |
| 42 | } |
| 43 | } |
| 44 | fetchVersion(); |
| 45 | }, []); |
| 46 |