Skip to content

Commit 08d33c3

Browse files
authored
Merge pull request #554 from Shariq2003/JSON_Reports
Added JSON Server Support in the Analyst Reports Page | Issue #493
2 parents f4325c5 + e98aec9 commit 08d33c3

File tree

2 files changed

+28
-10
lines changed

2 files changed

+28
-10
lines changed

data.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48359,5 +48359,11 @@
4835948359
{ "title": "SAP on Google Cloud: High availability", "description": "Architect SAP systems in Google Cloud for high availability." }
4836048360
]
4836148361
}
48362+
],
48363+
"reports": [
48364+
{ "title": "Google Cloud NGFW Enterprise Certified Secure Test Report", "description": "Read Miercom's test results on Google Cloud Next Generation Firewall Enterprise." },
48365+
{ "title": "Google Cloud NGFW Enterprise CyberRisk Validation Report", "description": "Read SecureIQlab's test results on Google Cloud Next Generation Firewall Enterprise." },
48366+
{ "title": "Google is a Leader in The Forrester Wave™: AI Foundation Models for Language, Q2 2024", "description": "Access your complimentary copy of the report to learn why Google was named a Leader." },
48367+
{ "title": "Google is a Leader in the 2024 Gartner® Magic Quadrant™ for Cloud AI Developer Services (CAIDS)", "description": "Access your complimentary copy of the report to learn why Google was named a Leader." }
4836248368
]
4836348369
}

src/app/(pages)/analyst-reports/page.jsx

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
11
"use client"
2-
import React from 'react';
3-
4-
const reports = [
5-
{ title: "Google Cloud NGFW Enterprise Certified Secure Test Report", description: "Read Miercom's test results on Google Cloud Next Generation Firewall Enterprise." },
6-
{ title: "Google Cloud NGFW Enterprise CyberRisk Validation Report", description: "Read SecureIQlab's test results on Google Cloud Next Generation Firewall Enterprise." },
7-
{ title: "Google is a Leader in The Forrester Wave™: AI Foundation Models for Language, Q2 2024", description: "Access your complimentary copy of the report to learn why Google was named a Leader." },
8-
{ title: "Google is a Leader in the 2024 Gartner® Magic Quadrant™ for Cloud AI Developer Services (CAIDS)", description: "Access your complimentary copy of the report to learn why Google was named a Leader." },
9-
// Add more reports as needed
10-
];
2+
import React, { useState, useEffect } from 'react';
113

124
const AnalystReportsPage = () => {
5+
const [reports, setReports] = useState([]);
6+
const [loading, setLoading] = useState(true);
7+
useEffect(() => {
8+
const fetchReports = async () => {
9+
try {
10+
const response = await fetch('http://localhost:5000/reports');
11+
const data = await response.json();
12+
setReports(data);
13+
} catch (error) {
14+
console.error("Error fetching reports:", error);
15+
} finally {
16+
setLoading(false);
17+
}
18+
};
19+
20+
fetchReports();
21+
}, []);
1322
return (
1423
<div className="bg-gray-50 min-h-screen p-6">
1524
{/* Header Section */}
@@ -49,7 +58,9 @@ const AnalystReportsPage = () => {
4958
<p className="text-gray-700 mb-6">
5059
Read what industry analysts are saying about Google Cloud. The reports listed here are written by third-party industry analysts that cover Google Cloud’s strategy, product portfolio, and differentiation. You can also learn more by reading whitepapers written by Google and the Google community.
5160
</p>
52-
61+
{loading ? (
62+
<div className="text-center">Loading reports...</div>
63+
) : (
5364
<div className="grid md:grid-cols-2 lg:grid-cols-3 gap-6">
5465
{reports.map((report, index) => (
5566
<div key={index} className="bg-white p-4 shadow-md rounded-lg hover:shadow-lg transition-shadow duration-200">
@@ -59,6 +70,7 @@ const AnalystReportsPage = () => {
5970
</div>
6071
))}
6172
</div>
73+
)}
6274
</section>
6375
</div>
6476

0 commit comments

Comments
 (0)