import React, { useState, useEffect } from 'react'; import clsx from 'clsx'; import { OrangeStarIcon } from './icons/orange-star'; export const LandingHeroGithubStars = () => { const [version, setVersion] = useState('0.2'); // Default version useEffect(() => { // Function to fetch version information const fetchVersion = async () => { try { const response = await fetch('https://get.openpanel.co/version'); const data = await response.text(); setVersion(data.trim()); // Update the version state } catch (error) { console.error('Failed to fetch version:', error); } }; fetchVersion(); }, []); // after initial render // Function to format version for URL const formatVersionForURL = (version) => { const parts = version.split('.'); return `${parts[0]}.${parts[1]}/#${parts[1]}${parts[2]}`; }; return (
OpenPanel {version} {" "} is out
); };