🚀 feat(App.tsx): add version number to the footer

The version number is now displayed in the footer of the application. The version number is fetched from the server using the /version endpoint and displayed in the footer. This allows users to easily identify which version of the application they are using.
This commit is contained in:
Gabriel Almeida 2023-05-22 08:39:39 -03:00
commit 13403de3fc

View file

@ -46,6 +46,15 @@ export default function App() {
}>
>([]);
// Initialize state variable for the version
const [version, setVersion] = useState("");
useEffect(() => {
fetch("/version")
.then((res) => res.json())
.then((data) => {
setVersion(data.version);
});
}, []);
// Use effect hook to update alertsList when a new alert is added
useEffect(() => {
// If there is an error alert open with data, add it to the alertsList
@ -158,9 +167,10 @@ export default function App() {
<a
target={"_blank"}
href="https://logspace.ai/"
className="absolute bottom-2 left-6 text-gray-300 px-2 rounded-lg text-xs cursor-pointer font-sans tracking-wide bg-gray-800 dark:bg-gray-300 dark:text-gray-800 "
className="absolute bottom-2 left-6 flex h-6 cursor-pointer flex-col items-center justify-start overflow-hidden rounded-lg bg-gray-800 px-2 text-center font-sans text-xs tracking-wide text-gray-300 transition-all duration-500 ease-in-out hover:h-12 dark:bg-gray-300 dark:text-gray-800"
>
Created by Logspace
{version && <div className="mt-1"> LangFlow v{version}</div>}
<div className="mt-2">Created by Logspace</div>
</a>
</div>
);