You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PlanCard.tsx 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import { Typography, Card, Flex } from 'antd';
  2. import { CheckCircleOutlined, CloseCircleOutlined } from '@ant-design/icons';
  3. import PrimaryButton from './PrimaryButton';
  4. const { Title, Text } = Typography;
  5. type Feature = {
  6. available: boolean;
  7. text: string;
  8. };
  9. type PlanCardProps = {
  10. title: string;
  11. price: string;
  12. description: string;
  13. features: Feature[];
  14. };
  15. const PlanCard: React.FC<PlanCardProps> = ({ title, price, description, features }) => {
  16. return (
  17. <Card
  18. bordered
  19. className="!w-full !h-full"
  20. bodyStyle={{ padding: 0 }}
  21. headStyle={{border:"none"}}
  22. title={<Title level={4} className="!mb-0 !text-blue-600">{title}</Title>}
  23. >
  24. <Flex justify="space-between" align="center" className="!p-4">
  25. <Flex gap={8}>
  26. <Title level={3} className="!m-0">{price}</Title>
  27. <div>
  28. <Text className="!text-xs !font-semibold block">Per agent</Text>
  29. <Text className="!text-xs !font-semibold block">Per month</Text>
  30. </div>
  31. </Flex>
  32. <Flex align='center'>
  33. <PrimaryButton customStyle="!font-bold !px-10 !rounded-md">Select</PrimaryButton>
  34. </Flex>
  35. </Flex>
  36. <div className="text-center border-y py-1 mb-2 !border-gray-300">
  37. <Text className="!text-xs">{description}</Text>
  38. </div>
  39. <Flex vertical gap={8} className="!px-8 !py-4">
  40. {features.map((feature, idx) => (
  41. <Flex key={idx} align="center" gap={6}>
  42. {feature.available ? (
  43. <CheckCircleOutlined className="!text-blue-600 text-xs" />
  44. ) : (
  45. <CloseCircleOutlined className="!text-red-500 text-xs" />
  46. )}
  47. <Text className="!text-xs !font-semibold">{feature.text}</Text>
  48. </Flex>
  49. ))}
  50. </Flex>
  51. </Card>
  52. );
  53. };
  54. export default PlanCard;