63 lines
2.9 KiB
TypeScript
63 lines
2.9 KiB
TypeScript
import React from 'react';
|
|||
|
|
import Link from 'next/link';
|
||
|
|
import { Globe, Smartphone, ArrowRight } from 'lucide-react';
|
||
|
|
import { ToolItem, AppItem, resolveLocalised } from '@/types';
|
||
|
|
|
||
|
|
interface AvailabilitySectionProps {
|
||
|
|
tool?: ToolItem;
|
||
|
|
homeApp?: AppItem | null;
|
||
|
|
locale?: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export function AvailabilitySection({ tool, homeApp, locale = 'en' }: AvailabilitySectionProps) {
|
||
|
|
if (!tool) return null;
|
||
|
|
return (
|
||
|
|
<section className="py-8 bg-white dark:bg-slate-900 border-t border-slate-200 dark:border-slate-800">
|
||
|
|
<div className="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8">
|
||
|
|
<h4 className="text-xs font-bold uppercase tracking-wider text-slate-500 dark:text-slate-400 mb-4 text-center">
|
||
|
|
Platform Availability for {resolveLocalised(tool.name, locale)}
|
||
|
|
</h4>
|
||
|
|
|
||
|
|
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
||
|
|
{/* Web Try */}
|
||
|
|
<div className="p-4 rounded-2xl border border-slate-200 dark:border-slate-800 bg-slate-50 dark:bg-slate-950 flex items-center justify-between">
|
||
|
|
<div className="flex items-center space-x-3">
|
||
|
|
<div className="w-10 h-10 rounded-xl bg-blue-50 dark:bg-blue-950 text-blue-600 flex items-center justify-center">
|
||
|
|
<Globe className="w-5 h-5" />
|
||
|
|
</div>
|
||
|
|
<div>
|
||
|
|
<p className="text-sm font-bold text-slate-900 dark:text-white">Web Browser</p>
|
||
|
|
<p className="text-xs text-slate-500 dark:text-slate-400">Free online try • Standard HD</p>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<span className="text-xs font-semibold text-emerald-600 dark:text-emerald-400 bg-emerald-50 dark:bg-emerald-950/60 px-2.5 py-1 rounded-md">
|
||
|
|
Live
|
||
|
|
</span>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
{/* Home App */}
|
||
|
|
{homeApp && (
|
||
|
|
<Link
|
||
|
|
href={`/go/${tool.slug}/${homeApp.slug}`}
|
||
|
|
className="p-4 rounded-2xl border border-blue-200 dark:border-blue-900 bg-blue-50/40 dark:bg-blue-950/30 hover:border-blue-500 transition-all flex items-center justify-between group"
|
||
|
|
>
|
||
|
|
<div className="flex items-center space-x-3">
|
||
|
|
<div className="w-10 h-10 rounded-xl bg-blue-600 text-white flex items-center justify-center shadow-md">
|
||
|
|
<Smartphone className="w-5 h-5" />
|
||
|
|
</div>
|
||
|
|
<div>
|
||
|
|
<p className="text-sm font-bold text-slate-900 dark:text-white group-hover:text-blue-600 transition-colors">
|
||
|
|
{resolveLocalised(homeApp.name, locale)}
|
||
|
|
</p>
|
||
|
|
<p className="text-xs text-blue-600 dark:text-blue-400">Home App • 4K Lossless & Batch</p>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<ArrowRight className="w-4 h-4 text-blue-600 group-hover:translate-x-1 transition-transform" />
|
||
|
|
</Link>
|
||
|
|
)}
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</section>
|
||
|
|
);
|
||
|
|
}
|