2026-11-03 12:24:43 +05:30
|
|
|
import React from 'react';
|
|
|
|
|
import Link from 'next/link';
|
2026-11-03 13:16:16 +05:30
|
|
|
import { Smartphone, Star, Check, ArrowRight } from 'lucide-react';
|
2026-11-03 12:24:43 +05:30
|
|
|
import { AppItem, resolveLocalised } from '@/types';
|
|
|
|
|
|
|
|
|
|
interface AppCardsSectionProps {
|
|
|
|
|
title?: any;
|
|
|
|
|
subtitle?: any;
|
|
|
|
|
apps?: AppItem[];
|
|
|
|
|
layout?: 'compact' | 'detailed';
|
|
|
|
|
showRating?: boolean;
|
|
|
|
|
locale?: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function AppCardsSection({
|
|
|
|
|
title,
|
|
|
|
|
subtitle,
|
|
|
|
|
apps = [],
|
|
|
|
|
showRating = true,
|
|
|
|
|
locale = 'en',
|
|
|
|
|
}: AppCardsSectionProps) {
|
|
|
|
|
return (
|
2026-11-03 13:16:16 +05:30
|
|
|
<section className="py-20 sm:py-28 bg-[#F5F2EB] border-y border-slate-900/[0.08]">
|
2026-11-03 12:24:43 +05:30
|
|
|
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
|
|
|
|
{(title || subtitle) && (
|
2026-11-03 13:16:16 +05:30
|
|
|
<div className="text-center max-w-3xl mx-auto mb-16 space-y-3">
|
2026-11-03 12:24:43 +05:30
|
|
|
{title && (
|
2026-11-03 13:16:16 +05:30
|
|
|
<h2 className="text-3xl sm:text-4xl lg:text-5xl font-display font-black text-slate-900 tracking-tight">
|
2026-11-03 12:24:43 +05:30
|
|
|
{resolveLocalised(title, locale)}
|
|
|
|
|
</h2>
|
|
|
|
|
)}
|
|
|
|
|
{subtitle && (
|
2026-11-03 13:16:16 +05:30
|
|
|
<p className="text-base sm:text-lg text-slate-600 font-normal">
|
2026-11-03 12:24:43 +05:30
|
|
|
{resolveLocalised(subtitle, locale)}
|
|
|
|
|
</p>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
2026-11-03 13:16:16 +05:30
|
|
|
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-7 sm:gap-8">
|
2026-11-03 12:24:43 +05:30
|
|
|
{apps.map((app) => (
|
|
|
|
|
<div
|
|
|
|
|
key={app.id}
|
2026-11-03 13:16:16 +05:30
|
|
|
className="bg-white rounded-3xl p-7 border border-slate-900/[0.08] shadow-cream-sm hover:shadow-cream-md hover:border-blue-400 hover:-translate-y-1 transition-all duration-300 flex flex-col justify-between"
|
2026-11-03 12:24:43 +05:30
|
|
|
>
|
|
|
|
|
<div>
|
|
|
|
|
{/* Header: Icon & Rating */}
|
2026-11-03 12:31:06 +05:30
|
|
|
<div className="flex items-center justify-between mb-5">
|
2026-11-03 13:16:16 +05:30
|
|
|
<div className="w-13 h-13 rounded-2xl bg-gradient-to-tr from-blue-600 via-indigo-600 to-cyan-500 flex items-center justify-center text-white shadow-md shadow-blue-500/20 p-3">
|
|
|
|
|
<Smartphone className="w-6 h-6" />
|
2026-11-03 12:24:43 +05:30
|
|
|
</div>
|
|
|
|
|
{showRating && (
|
2026-11-03 13:16:16 +05:30
|
|
|
<div className="flex items-center gap-1.5 bg-amber-50 border border-amber-200 px-3 py-1.5 rounded-full text-xs font-bold text-amber-800 shadow-sm">
|
2026-11-03 12:24:43 +05:30
|
|
|
<Star className="w-3.5 h-3.5 fill-amber-400 text-amber-400" />
|
|
|
|
|
<span>{app.rating.value}</span>
|
2026-11-03 13:16:16 +05:30
|
|
|
<span className="text-[10px] text-amber-600 font-normal">({(app.rating.count / 1000).toFixed(1)}k)</span>
|
2026-11-03 12:24:43 +05:30
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-11-03 13:16:16 +05:30
|
|
|
<h3 className="text-xl font-display font-bold text-slate-900">
|
2026-11-03 12:24:43 +05:30
|
|
|
{resolveLocalised(app.name, locale)}
|
|
|
|
|
</h3>
|
2026-11-03 13:16:16 +05:30
|
|
|
<p className="mt-1 text-xs text-blue-600 font-bold tracking-wide">
|
2026-11-03 12:24:43 +05:30
|
|
|
{resolveLocalised(app.tagline, locale)}
|
|
|
|
|
</p>
|
|
|
|
|
|
2026-11-03 13:16:16 +05:30
|
|
|
<p className="mt-3 text-xs text-slate-600 leading-relaxed line-clamp-3 font-normal">
|
2026-11-03 12:24:43 +05:30
|
|
|
{resolveLocalised(app.description, locale)}
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
{/* Features Checklist */}
|
|
|
|
|
{app.features && app.features.length > 0 && (
|
2026-11-03 13:16:16 +05:30
|
|
|
<div className="mt-5 pt-4 border-t border-slate-100 space-y-2">
|
2026-11-03 12:24:43 +05:30
|
|
|
{app.features.slice(0, 3).map((feat, idx) => (
|
2026-11-03 13:16:16 +05:30
|
|
|
<div key={idx} className="flex items-start gap-2 text-xs text-slate-700">
|
|
|
|
|
<Check className="w-3.5 h-3.5 text-blue-600 shrink-0 mt-0.5" />
|
2026-11-03 12:24:43 +05:30
|
|
|
<span className="line-clamp-1">{feat}</span>
|
|
|
|
|
</div>
|
|
|
|
|
))}
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-11-03 13:16:16 +05:30
|
|
|
<div className="mt-6 pt-4 border-t border-slate-100 space-y-3">
|
|
|
|
|
<p className="text-[10.5px] text-slate-400 italic text-center font-mono">
|
2026-11-03 12:24:43 +05:30
|
|
|
{resolveLocalised(app.creditsNote, locale, 'Credits and purchases are specific to this app.')}
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<Link
|
|
|
|
|
href={`/apps/${app.slug}`}
|
2026-11-03 13:16:16 +05:30
|
|
|
className="w-full inline-flex items-center justify-center gap-2 py-3.5 rounded-full text-xs font-bold text-white bg-slate-900 hover:bg-blue-600 transition-all duration-200 shadow-sm hover:shadow-md"
|
2026-11-03 12:24:43 +05:30
|
|
|
>
|
2026-11-03 12:31:06 +05:30
|
|
|
<span>Get App & 50 Bonus Credits</span>
|
2026-11-03 12:24:43 +05:30
|
|
|
<ArrowRight className="w-3.5 h-3.5" />
|
|
|
|
|
</Link>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
))}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
);
|
|
|
|
|
}
|