import React from 'react'; import { Row, Col } from 'antd'; import classNames from 'classnames'; import FeatureCard from './FeatureCard'; import styles from './Features.module.less'; interface Card { icon: string; title: string; description: string; } interface FeaturesProps { title?: string; features: Card[]; className?: string; style?: React.CSSProperties; id?: string; } const Features: React.FC = ({ title, features = [], className, style, id, }) => { const getCards = () => { const children = features.map(card => ( )); return children; }; // for small screen const getDots = () => { const dots: Array> = []; const { length } = features; const startTop = 45; const cardHeight = 350; const startLeftPercent = 0.028; const rows = length + 1; for (let i = 0; i < rows; i += 1) { const yOffset = 1; const top = `${startTop + cardHeight * i - yOffset}px`; const leftColLeft = `${startLeftPercent * 100}%`; const rigthColLeft = `${(startLeftPercent + 0.892) * 100}%`; dots.push(
, ); dots.push(
, ); } return dots; }; return (
{title ? (
) : (
)}
{getDots()}

{title}

{getCards()}
); }; export default Features;