mirror of
https://github.com/mblanke/holiday-travel-app.git
synced 2026-03-01 05:20:22 -05:00
Initial commit: Holiday Travel App with resort comparison, trip management, and multi-provider search
This commit is contained in:
29
components/DealCard.tsx
Normal file
29
components/DealCard.tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
'use client';
|
||||
import { ExternalLink, Plane, Calendar, DollarSign, Link as LinkIcon } from "lucide-react";
|
||||
import type { Deal } from "@/lib/types";
|
||||
|
||||
export default function DealCard({ deal }: { deal: Deal }) {
|
||||
return (
|
||||
<div className="card p-4 flex flex-col gap-3">
|
||||
<div className="flex items-start justify-between gap-3">
|
||||
<div>
|
||||
<h3 className="text-base md:text-lg font-semibold">{deal.title}</h3>
|
||||
<div className="mt-1 flex flex-wrap gap-2">
|
||||
<span className="badge">{deal.source}</span>
|
||||
{deal.destination && <span className="badge"><Plane className="w-3 h-3 mr-1" /> {deal.origin} → {deal.destination}</span>}
|
||||
{deal.nights != null && <span className="badge"><Calendar className="w-3 h-3 mr-1" /> {deal.nights} nights</span>}
|
||||
{deal.price != null && <span className="badge"><DollarSign className="w-3 h-3 mr-1" />{deal.price} {deal.currency || ""}</span>}
|
||||
</div>
|
||||
</div>
|
||||
<a className="btn" href={deal.link} target="_blank" rel="noreferrer">
|
||||
Open <ExternalLink className="w-4 h-4 ml-2" />
|
||||
</a>
|
||||
</div>
|
||||
<div className="text-sm opacity-80 flex gap-4">
|
||||
{deal.startDate && <span>Depart: {deal.startDate}</span>}
|
||||
{deal.endDate && <span>Return: {deal.endDate}</span>}
|
||||
<span className="ml-auto flex items-center gap-1"><LinkIcon className="w-3 h-3" /> {new URL(deal.link, "http://x").host}</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
8
components/Section.tsx
Normal file
8
components/Section.tsx
Normal file
@@ -0,0 +1,8 @@
|
||||
export default function Section({ title, children }: { title: string, children: React.ReactNode }) {
|
||||
return (
|
||||
<section className="space-y-3">
|
||||
<h2 className="text-lg font-semibold">{title}</h2>
|
||||
<div className="card p-4">{children}</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user