2026-11-03 12:24:43 +05:30
|
|
|
'use client';
|
|
|
|
|
|
|
|
|
|
import React, { useState } from 'react';
|
|
|
|
|
import Link from 'next/link';
|
2026-11-03 13:16:16 +05:30
|
|
|
import { HelpCircle, ArrowRight, Smile, RefreshCcw, Scissors, Palette } from 'lucide-react';
|
2026-11-03 12:24:43 +05:30
|
|
|
import { AppItem, resolveLocalised } from '@/types';
|
|
|
|
|
|
|
|
|
|
interface AppPickerSectionProps {
|
|
|
|
|
title?: any;
|
|
|
|
|
subtitle?: any;
|
|
|
|
|
apps?: AppItem[];
|
|
|
|
|
locale?: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function AppPickerSection({
|
|
|
|
|
title,
|
|
|
|
|
subtitle,
|
|
|
|
|
apps = [],
|
|
|
|
|
locale = 'en',
|
|
|
|
|
}: AppPickerSectionProps) {
|
|
|
|
|
const [photoGoal, setPhotoGoal] = useState<string>('portrait');
|
|
|
|
|
|
|
|
|
|
const goalOptions = [
|
|
|
|
|
{
|
|
|
|
|
id: 'portrait',
|
|
|
|
|
title: 'Portraits, Selfies & Skin Beauty',
|
|
|
|
|
desc: 'Acne, blemish removal, teeth whitening, eye redness',
|
2026-11-03 12:31:06 +05:30
|
|
|
icon: Smile,
|
2026-11-03 12:24:43 +05:30
|
|
|
appSlug: 'portrait-app',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 'restoration',
|
|
|
|
|
title: 'Blurry, Damaged or Old Photos',
|
2026-11-03 12:31:06 +05:30
|
|
|
desc: 'Fixing scratches, sharpening faces, colorizing black & white',
|
|
|
|
|
icon: RefreshCcw,
|
2026-11-03 12:24:43 +05:30
|
|
|
appSlug: 'photo-enhancer-pro',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 'cutout',
|
2026-11-03 12:31:06 +05:30
|
|
|
title: 'Background Cutout & Eraser',
|
|
|
|
|
desc: 'Transparent PNGs, e-commerce products, erasing strangers',
|
|
|
|
|
icon: Scissors,
|
2026-11-03 12:24:43 +05:30
|
|
|
appSlug: 'bg-cleaner-app',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 'art',
|
|
|
|
|
title: 'Anime, Cartoon & Vintage Film Art',
|
2026-11-03 12:31:06 +05:30
|
|
|
desc: 'Cartoon avatars, Polaroid frames, manga illustrations',
|
|
|
|
|
icon: Palette,
|
2026-11-03 12:24:43 +05:30
|
|
|
appSlug: 'art-studio-app',
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const matchedGoal = goalOptions.find((g) => g.id === photoGoal) || goalOptions[0];
|
|
|
|
|
const recommendedApp = apps.find((a) => a.slug === matchedGoal.appSlug) || apps[0];
|
|
|
|
|
|
|
|
|
|
return (
|
2026-11-03 13:16:16 +05:30
|
|
|
<section className="py-20 sm:py-28 bg-[#F5F2EB] border-t border-slate-900/[0.08]">
|
2026-11-03 12:24:43 +05:30
|
|
|
<div className="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8">
|
2026-11-03 13:16:16 +05:30
|
|
|
<div className="text-center space-y-3 mb-12">
|
|
|
|
|
<div className="inline-flex items-center gap-2 px-3.5 py-1.5 rounded-full bg-blue-50 text-blue-700 text-xs font-mono font-semibold border border-blue-200 shadow-sm">
|
|
|
|
|
<HelpCircle className="w-3.5 h-3.5 text-blue-600" />
|
|
|
|
|
<span>INTERACTIVE APP MATCHER</span>
|
2026-11-03 12:24:43 +05:30
|
|
|
</div>
|
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, 'Not Sure Which App You Need?')}
|
|
|
|
|
</h2>
|
2026-11-03 13:16:16 +05:30
|
|
|
<p className="text-base sm:text-lg text-slate-600 max-w-lg mx-auto font-normal">
|
2026-11-03 12:31:06 +05:30
|
|
|
{resolveLocalised(subtitle, locale, 'Select what you want to edit and find your tailored CRE Innovations app.')}
|
2026-11-03 12:24:43 +05:30
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-11-03 13:16:16 +05:30
|
|
|
<div className="bg-white rounded-3xl p-7 sm:p-10 border border-slate-900/[0.08] shadow-cream-md space-y-8">
|
2026-11-03 12:24:43 +05:30
|
|
|
<div>
|
2026-11-03 13:16:16 +05:30
|
|
|
<label className="block text-xs font-mono uppercase tracking-wider text-slate-500 font-semibold mb-4">
|
2026-11-03 12:31:06 +05:30
|
|
|
Select Your Creative Goal:
|
2026-11-03 12:24:43 +05:30
|
|
|
</label>
|
2026-11-03 13:16:16 +05:30
|
|
|
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
2026-11-03 12:31:06 +05:30
|
|
|
{goalOptions.map((opt) => {
|
|
|
|
|
const Icon = opt.icon;
|
|
|
|
|
const isSelected = photoGoal === opt.id;
|
|
|
|
|
return (
|
|
|
|
|
<button
|
|
|
|
|
key={opt.id}
|
|
|
|
|
onClick={() => setPhotoGoal(opt.id)}
|
2026-11-03 13:16:16 +05:30
|
|
|
className={`p-5 rounded-2xl border text-left transition-all duration-200 flex items-start gap-4 ${
|
2026-11-03 12:31:06 +05:30
|
|
|
isSelected
|
2026-11-03 13:16:16 +05:30
|
|
|
? 'border-blue-600 bg-blue-50/60 shadow-sm ring-2 ring-blue-500/20'
|
|
|
|
|
: 'border-slate-200 hover:border-slate-300 bg-[#FAF8F5]'
|
2026-11-03 12:31:06 +05:30
|
|
|
}`}
|
|
|
|
|
>
|
2026-11-03 13:16:16 +05:30
|
|
|
<div className={`w-10 h-10 rounded-xl flex items-center justify-center shrink-0 mt-0.5 ${
|
|
|
|
|
isSelected ? 'bg-blue-600 text-white' : 'bg-white border border-slate-200 text-slate-600'
|
2026-11-03 12:31:06 +05:30
|
|
|
}`}>
|
2026-11-03 13:16:16 +05:30
|
|
|
<Icon className="w-5 h-5" />
|
2026-11-03 12:31:06 +05:30
|
|
|
</div>
|
|
|
|
|
<div>
|
2026-11-03 13:16:16 +05:30
|
|
|
<p className="font-display font-bold text-base text-slate-900">
|
2026-11-03 12:31:06 +05:30
|
|
|
{opt.title}
|
|
|
|
|
</p>
|
2026-11-03 13:16:16 +05:30
|
|
|
<p className="text-xs text-slate-600 mt-1 leading-relaxed font-normal">
|
2026-11-03 12:31:06 +05:30
|
|
|
{opt.desc}
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</button>
|
|
|
|
|
);
|
|
|
|
|
})}
|
2026-11-03 12:24:43 +05:30
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-11-03 12:31:06 +05:30
|
|
|
{/* Recommended Result Box */}
|
2026-11-03 12:24:43 +05:30
|
|
|
{recommendedApp && (
|
2026-11-03 13:16:16 +05:30
|
|
|
<div className="pt-6 border-t border-slate-100 flex flex-col sm:flex-row items-start sm:items-center justify-between gap-6 bg-gradient-to-r from-blue-50 via-indigo-50 to-blue-50 p-6 sm:p-8 rounded-2xl border border-blue-200/80 shadow-sm">
|
2026-11-03 12:24:43 +05:30
|
|
|
<div className="space-y-1">
|
2026-11-03 13:16:16 +05:30
|
|
|
<span className="text-[11px] font-mono font-bold uppercase tracking-wider text-blue-700">
|
2026-11-03 12:31:06 +05:30
|
|
|
★ Recommended Match
|
2026-11-03 12:24:43 +05:30
|
|
|
</span>
|
2026-11-03 13:16:16 +05:30
|
|
|
<h4 className="text-xl sm:text-2xl font-display font-bold text-slate-900">
|
2026-11-03 12:24:43 +05:30
|
|
|
{resolveLocalised(recommendedApp.name, locale)}
|
|
|
|
|
</h4>
|
2026-11-03 13:16:16 +05:30
|
|
|
<p className="text-xs sm:text-sm text-slate-600 font-normal">
|
2026-11-03 12:24:43 +05:30
|
|
|
{resolveLocalised(recommendedApp.tagline, locale)}
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<Link
|
|
|
|
|
href={`/apps/${recommendedApp.slug}`}
|
2026-11-03 13:16:16 +05:30
|
|
|
className="w-full sm:w-auto shrink-0 inline-flex items-center justify-center gap-2 px-6 py-3.5 rounded-full text-xs font-bold text-white bg-blue-600 hover:bg-blue-700 shadow-sm shadow-blue-500/25 transition-all hover:scale-105 active:scale-95"
|
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-4 h-4" />
|
|
|
|
|
</Link>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
);
|
|
|
|
|
}
|