65 lines
2.7 KiB
TypeScript
65 lines
2.7 KiB
TypeScript
import React from 'react';
|
|||
|
|
import Link from 'next/link';
|
||
|
|
import { ArrowRight, Wand2 } from 'lucide-react';
|
||
|
|
import { ToolItem, resolveLocalised } from '@/types';
|
||
|
|
|
||
|
|
interface RelatedToolsSectionProps {
|
||
|
|
tools?: ToolItem[];
|
||
|
|
locale?: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export function RelatedToolsSection({ tools = [], locale = 'en' }: RelatedToolsSectionProps) {
|
||
|
|
if (!tools || tools.length === 0) return null;
|
||
|
|
|
||
|
|
return (
|
||
|
|
<section className="py-12 bg-slate-50/50 dark:bg-slate-950/40 border-t border-slate-200 dark:border-slate-800">
|
||
|
|
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
||
|
|
<div className="flex items-center justify-between mb-8">
|
||
|
|
<div>
|
||
|
|
<h3 className="text-2xl font-bold text-slate-900 dark:text-white">
|
||
|
|
Related AI Tools
|
||
|
|
</h3>
|
||
|
|
<p className="text-xs text-slate-500 dark:text-slate-400">
|
||
|
|
Explore more tools to enhance your photo editing workflow
|
||
|
|
</p>
|
||
|
|
</div>
|
||
|
|
<Link
|
||
|
|
href="/tools"
|
||
|
|
className="text-xs font-semibold text-blue-600 dark:text-blue-400 hover:underline flex items-center space-x-1"
|
||
|
|
>
|
||
|
|
<span>View all tools</span>
|
||
|
|
<ArrowRight className="w-3.5 h-3.5" />
|
||
|
|
</Link>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6">
|
||
|
|
{tools.map((tool) => (
|
||
|
|
<Link
|
||
|
|
key={tool.id}
|
||
|
|
href={`/tools/${tool.slug}`}
|
||
|
|
className="group p-5 rounded-2xl bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 shadow-sm hover:shadow-md hover:border-blue-500 transition-all flex flex-col justify-between"
|
||
|
|
>
|
||
|
|
<div>
|
||
|
|
<div className="w-8 h-8 rounded-lg bg-blue-50 dark:bg-blue-950 text-blue-600 flex items-center justify-center mb-3 group-hover:scale-110 transition-transform">
|
||
|
|
<Wand2 className="w-4 h-4" />
|
||
|
|
</div>
|
||
|
|
<h4 className="font-bold text-slate-900 dark:text-white text-sm group-hover:text-blue-600 transition-colors">
|
||
|
|
{resolveLocalised(tool.name, locale)}
|
||
|
|
</h4>
|
||
|
|
<p className="mt-1 text-xs text-slate-500 dark:text-slate-400 line-clamp-2">
|
||
|
|
{resolveLocalised(tool.summary, locale)}
|
||
|
|
</p>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div className="mt-4 pt-3 border-t border-slate-100 dark:border-slate-800 text-xs font-medium text-blue-600 dark:text-blue-400 flex items-center justify-between">
|
||
|
|
<span>Try free</span>
|
||
|
|
<ArrowRight className="w-3 h-3 group-hover:translate-x-1 transition-transform" />
|
||
|
|
</div>
|
||
|
|
</Link>
|
||
|
|
))}
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</section>
|
||
|
|
);
|
||
|
|
}
|