import styles from './index.module.scss'; import { motion } from 'framer-motion'; const PRESET_COUNT = [2, 3, 4]; const getGridClass = (count?: number): string => { if (!count) { return ''; } else if (PRESET_COUNT.includes(count)) { return `grid-${12 / count}`; } else if (count % 3 === 0) { return 'grid-4'; } else if (count % 2 === 0) { return 'grid-6'; } return ''; }; export interface Feature { icon: string; title: string; details: string; link?: string; } export function HomeFeature({ features }: { features: Feature[] }) { const gridClass = getGridClass(features?.length); return (
{features?.map((feature, index) => { const { icon, title, details, link } = feature; return (
{ if (link) { window.location.href = link; } }} >
{icon}

{title}

{details}

); })}
); }