"use client";
import React from "react";
import Image from "next/image";
interface Feature {
id: number;
details: string;
}
interface Offer {
id: number;
details: string;
}
interface CreditCard {
id: number;
name: string;
bankname: string;
minSalary: number;
annualFee: string;
image: string;
features: Feature[];
offers: Offer[];
}
const Card: React.FC<{ card: CreditCard }> = ({ card }) => {
return (
{/* Left Column: Image */}
{/* Right Column: Details */}
{/* Bank Name & Card Name - full width on mobile, flexible on larger screens */}
{card.bankname}
{card.name}
{/* Minimum Salary */}
Minimum Salary
(AED): {card.minSalary}
{/* Annual Fee */}
Annual Fee
{card.annualFee}
{/* Horizontal line */}
{/* Offers + Buttons Row */}
{card.offers && card.offers.length > 0 && (
{/* Offers Section */}
🎁 Offers
{card.offers.map((offer) => (
- {offer.details}
))}
)}
{/* Features Section */}
{card.features && card.features.length > 0 && (
✨ Features:
{card.features.slice(0, 4).map((feature) => (
✔
{feature.details}
))}
)}
);
};
export default Card;