| 1 | import { useState } from "react"; |
| 2 | import { Smartphone } |
| 3 | import type { BentoFeature |
| 4 | |
| 5 | type FeatureItemProps |
| 6 | feature: BentoFeature |
| 7 | index: number |
| 8 | }; |
| 9 | |
| 10 | export function FeatureItem({ |
| 11 | const [imageError, |
| 12 | const isEven = |
| 13 | |
| 14 | return ( |
| 15 | <div |
| 16 | className={`flex flex-col ${ |
| 17 | isEven ? "lg:flex-row" |
| 18 | } items-center gap-12 lg:gap-16`} |
| 19 | > |
| 20 | {/* Content Section */} |
| 21 | <div className="flex-1 space-y-6 |
| 22 | <div className="w-14 h-14 rounded-xl bg-primary/10 flex items-center justify-center text-primary |
| 23 | {feature.icon} |
| 24 | </div> |
| 25 | <h3 className="text-2xl sm:text-3xl font-bold |
| 26 | <p className="text-lg text-muted-foreground leading-relaxed |
| 27 | {feature.description} |
| 28 | </p> |
| 29 | </div> |
| 30 | |
| 31 | {/* Image Section */} |
| 32 | {feature.screenshot && |
| 33 | <div className="flex-1 w-full max-w-md |
| 34 | <div className="relative rounded-2xl flex items-center justify-center overflow-hidden group |
| 35 | {!imageError ? ( |
| 36 | <img |
| 37 | src={feature.screenshot |
| 38 | alt={feature.title |
| 39 | className="w-full h-full object-contain transition-transform duration-500" |
| 40 | onError={() => |
| 41 | /> |
| 42 | ) : ( |
| 43 | <Smartphone className=" |
| 44 | )} |
| 45 | </div> |
| 46 | </div> |
| 47 | )} |
| 48 | </div> |
| 49 | ); |
| 50 | } |