diff --git a/frontend/src/components/Card.tsx b/frontend/src/components/Card.tsx index 20ece61..bc07ee5 100644 --- a/frontend/src/components/Card.tsx +++ b/frontend/src/components/Card.tsx @@ -1,44 +1,50 @@ -import {ScrollShadow} from "@heroui/react"; -import { useEffect, useState } from "react"; +import { Card } from "@heroui/react"; +// import { useEffect, useState } from "react"; -export default function Card() { +export default function Default() { // Data - const [data, setData] = useState(null) - const [loading, setLoading] = useState(true) - - // Load Data - useEffect(() => { - const fetchData = async () => { - try { - const response = await fetch('http://localhost:8080/agent/card/你好') - if (!response.ok) { - throw new Error('API Error'); - } - const result = await response.json(); - setData(result); - } catch (error) { - console.error("Failed to fetch data: ", error); - } finally { - setLoading(false); - } - }; - fetchData(); - }, []); + // const [data, setData] = useState(null); + // const [loading, setLoading] = useState(true); + // Load Data + // useEffect(() => { + // const fetchData = async () => { + // try { + // const response = await fetch("http://localhost:8080/agent/card/你好"); + // if (!response.ok) { + // throw new Error("API Error"); + // } + // const result = await response.json(); + // setData(result); + // } catch (error) { + // console.error("Failed to fetch data: ", error); + // } finally { + // setLoading(false); + // } + // }; + // fetchData(); + // }, []); return (
Loading data...
- ) : ( - // 4. 渲染从 API 获取的数据 -{data?.message}
- )}
-