From 1468eb1df32073e482f5377a15ffaf36b31ccee6 Mon Sep 17 00:00:00 2001 From: yerimming <120501910+yerimming@users.noreply.github.com> Date: Sun, 19 Jul 2026 15:28:15 +0900 Subject: [PATCH] Add HealthComponent to display service health status --- src/components/HealthComponent.jsx | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/components/HealthComponent.jsx diff --git a/src/components/HealthComponent.jsx b/src/components/HealthComponent.jsx new file mode 100644 index 0000000..380eefd --- /dev/null +++ b/src/components/HealthComponent.jsx @@ -0,0 +1,32 @@ +import React, { useEffect, useState } from 'react'; + +const HealthComponent = () => { + const [isHealthy, setIsHealthy] = useState(null); + + useEffect(() => { + const fetchHealth = async () => { + try { + const response = await fetch('/api/v1/health'); + const data = await response.json(); + setIsHealthy(data.healthy); + } catch (error) { + setIsHealthy(false); + } + }; + fetchHealth(); + }, []); + + return ( +