Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Startup detail pages #109

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions app/e-lab/startups/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import startups from '@data/e-lab-startups.json';
import StartupDetails from '@components/StartupDetails';

export async function generateStaticParams() {
return await Promise.resolve(startups.map((startup) => ({
id: startup.id,
})));
}

export default function StartupPage({ params }: { params: { id: string } }) {
const startup = startups.find((s) => s.id === params.id);

if (!startup) {
return <div>Startup not found</div>;
}

return <StartupDetails startup={startup} />;
}
56 changes: 56 additions & 0 deletions components/StartupDetails.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import Image from 'next/image';
import Link from 'next/link';
import { Startup } from '@data/e-lab';

const StartupDetails = ({ startup }: { startup: Startup }) => {
return (
<div className="bg-purple-950 text-white min-h-screen p-8">
<div className="max-w-4xl mx-auto">
<div className="flex items-center mb-8">
<Image
src={startup.logo}
alt={`${startup.name} logo`}
width={100}
height={100}
className="mr-4"
/>
<h1 className="text-4xl font-bold">{startup.name}</h1>
</div>

<p className="text-xl mb-8">{startup.description}</p>

<h2 className="text-2xl font-semibold mb-4">Founders</h2>
<ul className="mb-8">
{startup.founders.map((founder) => (
<li key={founder.name} className="mb-2">
<span className="font-bold">{founder.name}</span> - {founder.role}
</li>
))}
</ul>

<h2 className="text-2xl font-semibold mb-4">Metrics</h2>
<ul className="mb-8">
{Object.entries(startup.metrics).map(([key, value]) => (
<li key={key} className="mb-2">
<span className="font-bold">{key}:</span> {String(value)}
</li>
))}
</ul>

<h2 className="text-2xl font-semibold mb-4">About {startup.name}</h2>
<p className="mb-8">{startup.about}</p>

<Link
href={startup.website}
target="_blank"
rel="noopener noreferrer"
className="bg-yellow-500 text-black px-4 py-2 rounded-full font-semibold hover:bg-yellow-600 transition-colors"
>
Visit Website
</Link>
</div>
</div>
);
};

export default StartupDetails;
30 changes: 30 additions & 0 deletions data/e-lab-startups.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[
{
"id": "airbnb",
"name": "Airbnb",
"description": "Airbnb is an online marketplace for short-term homestays and experiences.",
"founders": [
{
"name": "Brian Chesky",
"role": "CEO, Co-founder"
},
{
"name": "Joe Gebbia",
"role": "Co-founder"
},
{
"name": "Nathan Blecharczyk",
"role": "Chief Strategy Officer, Co-founder"
}
],
"metrics": {
"Year Founded": "2008",
"Valuation": "$113 billion",
"Funding Raised": "$6.4 billion",
"Employees": "6,132"
},
"about": "Airbnb has revolutionized the travel industry by allowing homeowners to rent out their spaces to travelers. Founded in 2008, the company has grown from a small startup to a global phenomenon, operating in over 220 countries and regions. Airbnb's platform not only provides unique accommodation options for travelers but also empowers hosts to earn extra income. The company's success lies in its ability to create a trusted community marketplace and its continuous innovation in the travel and hospitality sector.",
"website": "https://www.airbnb.com",
"logo": "/assets/e-lab/startups/airbnb-logo.png"
}
]
18 changes: 18 additions & 0 deletions data/e-lab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,21 @@ export const faq = [
"The AI E-Lab is a part-time program. Keep in mind that the more you commit, the more you get out of this program.",
},
];

export interface Founder {
name: string;
role: string;
}

export type Metrics = Record<string, string>;

export interface Startup {
id: string;
name: string;
description: string;
founders: Founder[];
metrics: Metrics;
website: string;
logo: string;
about?: string;
}
3 changes: 3 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
"@components/*": [
"./components/*"
],
"@data/*": [
"./data/*"
],
"@ui/*": [
"./components/ui/*"
],
Expand Down
Loading