Branchwell

Inkspring / website / src / Compare.tsx

1import React from 'react';
2import { AppleIcon } from './AppleIcon';
3import { compare } from './compare.js';
4import './help.css';
5import './compare.css';
6
7export default function Compare() {
8 const { title, lead, intro, columns, rows, picks, faqs, sources, checked } = compare;
9 return <main className="wrap help-main compare-main">
10 <header className="compare-intro">
11 <h1>{title}</h1>
12 <p>{lead}</p>
13 </header>
14 <div className="help-guides">
15 <section aria-labelledby="differ-heading">
16 <h2 id="differ-heading">How they differ</h2>
17 <p>{intro}</p>
18 <div className="compare-scroll" role="region" aria-labelledby="differ-heading" tabIndex={0}>
19 <table className="compare">
20 <thead><tr><td />{columns.map(name => <th scope="col" key={name}>{name}</th>)}</tr></thead>
21 <tbody>
22 {rows.map(([label, ...cells]) => <tr key={label}>
23 <th scope="row">{label}</th>
24 {cells.map((cell, index) => <td key={columns[index]}>{cell}</td>)}
25 </tr>)}
26 </tbody>
27 </table>
28 </div>
29 </section>
30 <section aria-labelledby="choose-heading">
31 <h2 id="choose-heading">Which one to choose</h2>
32 {picks.map(([when, why]) => <p key={when}><strong>{when}</strong> {why}</p>)}
33 <a className="btn" href="/download"><AppleIcon />Download Inkspring for Mac</a>
34 </section>
35 <section id="questions" aria-labelledby="questions-heading">
36 <h2 id="questions-heading">Common questions</h2>
37 {faqs.map(({ q, a }) => <article className="help-guide" key={q}>
38 <h3>{q}</h3>
39 <p>{a}</p>
40 </article>)}
41 </section>
42 <section aria-labelledby="sources-heading">
43 <h2 id="sources-heading">Sources</h2>
44 <p>Facts about the other products come from their own pages, read on {checked}. Products change, so check their pages for the latest. Inkspring’s own details are on the <a href="/">home page</a> and in <a href="/help">Help</a>.</p>
45 <ul className="compare-sources">
46 {sources.map(([label, href]) => <li key={href}><a href={href}>{label}</a></li>)}
47 </ul>
48 </section>
49 </div>
50 </main>;
51}