import { t } from "@lingui/core/macro"; import { HiCheckCircle, HiXCircle } from "react-icons/hi2"; interface Feature { key: string; label: string; kan: boolean | string; trello: boolean | string; } interface Section { name: string; features: Feature[]; } type FrequencyValue = "monthly" | "annually"; const CellValue = ({ value }: { value: boolean | string }) => { if (typeof value === "string") { return ( {value} ); } return value ? ( ) : ( ); }; const FeatureComparisonTable = ({ frequencyValue, }: { frequencyValue: FrequencyValue; }) => { const sections: Section[] = [ { name: t`Core features`, features: [ { key: "ulimited-workspaces", label: t`Unlimited workspaces`, kan: true, trello: false, }, { key: "unlimited-boards", label: t`Unlimited boards`, kan: true, trello: false, }, { key: "unlimited-lists", label: t`Unlimited lists`, kan: true, trello: true, }, { key: "unlimited-cards", label: t`Unlimited cards`, kan: true, trello: true, }, { key: "activity-log", label: t`Activity log`, kan: true, trello: true, }, { key: "templates", label: t`Custom templates`, kan: true, trello: false, }, { key: "labels", label: t`Labels & filters`, kan: true, trello: true }, { key: "checklists", label: t`Checklists`, kan: true, trello: true }, { key: "import", label: t`Import from Trello`, kan: true, trello: false, }, { key: "visibility", label: t`Board visibility`, kan: true, trello: true, }, { key: "search", label: t`Intelligent search`, kan: true, trello: true, }, { key: "workspace-url", label: t`Custom workspace link`, kan: true, trello: false, }, ], }, { name: t`Teams`, features: [ { key: "pricing", label: t`Price per user/month`, kan: frequencyValue === "monthly" ? `$10.00` : `$8.00`, trello: frequencyValue === "monthly" ? `$12.00` : `$10.00`, }, { key: "comments", label: t`Comments & mentions`, kan: true, trello: true, }, { key: "assignments", label: t`Assignees`, kan: true, trello: true, }, { key: "sharing", label: t`Board sharing & invites`, kan: true, trello: true, }, { key: "invite-links", label: t`Invite links`, kan: true, trello: true, }, ], }, { name: t`Platform`, features: [ { key: "api", label: t`REST API`, kan: true, trello: true, }, { key: "open-source", label: t`Open source`, kan: true, trello: false, }, { key: "self-hostable", label: t`Self-hostable`, kan: true, trello: false, }, { key: "white-label", label: t`White label`, kan: true, trello: false, }, { key: "performance", label: t`Fast & lightweight`, kan: true, trello: false, }, { key: "this-is-a-joke", label: t`Owned by Atlassian`, kan: false, trello: true, }, ], }, ]; const products = [ { id: "kan", name: t`Kan`, featured: true, }, { id: "trello", name: t`Trello`, featured: false, }, ]; return ( {products.map((product) => ( {product.name} ))} {sections.map((section) => ( {section.name} {products.map((product) => ( ))} {t`Feature`} {products.map((p) => ( {p.name} ))} {section.features.map((feature, featureIdx) => ( {feature.label} {featureIdx !== section.features.length - 1 ? ( ) : null} {products.map((p) => ( ))} ))} {products.map((product) => ( ))} ))} ); }; export default FeatureComparisonTable;
{product.name}