news widget redesign 6
This commit is contained in:
parent
4143b7b4dd
commit
2604e94912
@ -90,7 +90,7 @@ export async function GET() {
|
||||
try {
|
||||
console.log('Fetching news from FastAPI server...');
|
||||
|
||||
const response = await fetch(`${API_URL}/news?limit=10`, {
|
||||
const response = await fetch(`${API_URL}/news?limit=12`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
|
||||
@ -99,14 +99,14 @@ export function News() {
|
||||
{error ? (
|
||||
<p className="text-center text-red-500">{error}</p>
|
||||
) : (
|
||||
<div className="space-y-2 max-h-[220px] overflow-y-auto pr-1 scrollbar-thin scrollbar-thumb-gray-200 scrollbar-track-transparent">
|
||||
<div className="space-y-1.5 max-h-[calc(100vh-12rem)] overflow-y-auto pr-1 scrollbar-thin scrollbar-thumb-gray-200 scrollbar-track-transparent">
|
||||
{news.length === 0 ? (
|
||||
<p className="text-center text-gray-500">No news available</p>
|
||||
) : (
|
||||
news.map((item) => (
|
||||
<div
|
||||
key={item.id}
|
||||
className="p-2 hover:bg-gray-50/50 rounded-lg transition-colors cursor-pointer border border-gray-100 shadow-sm"
|
||||
className="p-1.5 hover:bg-gray-50/50 rounded-lg transition-colors cursor-pointer border border-gray-100 shadow-sm"
|
||||
onClick={() => window.open(item.url, '_blank')}
|
||||
>
|
||||
<div className="flex items-center justify-between mb-1">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user