imnya.ng/src/components/Home/AboutOld.tsx

43 lines
No EOL
1.6 KiB
TypeScript

import { useEffect, useState } from "react";
export default function About() {
const [posts, setPosts] = useState<any[]>([]);
useEffect(() => {
fetch("https://api.imnya.ng/rss", {
method: "GET",
headers: {
"Content-Type": "application/json"
}
})
.then(response => response.json())
.then(data => {
if (data) {
setPosts(data.slice(0, 3));
} else {
console.error("Error: data is undefined");
}
})
.catch(error => console.error("Error fetching posts:", error));
}, []);
return (
<div className="w-full h-screen flex flex-col items-center justify-center">
<div className="w-full md:w-[50%] p-4">
<h1 className="text-2xl font-bold">🤔 About</h1>
<p className="mt-2">! .</p>
<p>With <a href="https://sqlare.com">Sqlare</a>, <a href="https://team.orygonix.com">TEAM. ORYGON:IX</a></p>
</div>
<div className="w-full md:w-[50%] p-4">
<strong> </strong>
<ul>
{posts.map((post, index) => (
<li key={index}>
<a href={post.link}>{post.title}</a>
</li>
))}
</ul>
</div>
</div>
);
}