xref: /aosp_15_r20/external/jspecify/docs/src/components/HomepageFeatures/index.js (revision 2167191df2fa07300797f1ac5b707370b5f38c48)
1/*
2 * Copyright 2022 The JSpecify Authors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *     http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17import React from 'react';
18import clsx from 'clsx';
19import styles from './styles.module.css';
20
21const FeatureListSvg = [
22  {
23    title: 'Standard Annotations',
24    Svg: require('@site/static/img/jspecify-landing-annot.svg').default,
25    description: (
26      <>
27	JSpecify is releasing the first artifact of tool-independent annotations
28        for powering static analysis checks in your Java code.
29      </>
30    ),
31  },
32  {
33    title: 'Next Level Static Analysis',
34    Svg: require('@site/static/img/jspecify-landing-bugs.svg').default,
35    description: (
36      <>
37	JSpecify defines precise semantics, letting analysis tools find more
38	bugs, and more consistently. Library owners won't have to decide which
39        tool to support.
40      </>
41    ),
42  },
43];
44
45const FeatureListPng = [
46  {
47    title: 'Community Effort',
48    Png: require('@site/static/img/jspecify-landing-community.png').default,
49    description: (
50      <>
51        JSpecify is developed by consensus of members representing a variety of
52        stakeholders in Java static analysis, and we welcome your participation.
53      </>
54    ),
55  },
56];
57
58
59function FeatureSvg({Svg, title, description}) {
60  return (
61    <div className={clsx('col col--4')}>
62      <div className="text--center">
63        <Svg className={styles.featureSvg} role="img" />
64      </div>
65      <div className="text--center padding-horiz--md">
66        <h3>{title}</h3>
67        <p>{description}</p>
68      </div>
69    </div>
70  );
71}
72
73function FeaturePng({Png, title, description}) {
74  return (
75    <div className={clsx('col col--4')}>
76      <div className="text--center">
77        <img src={Png} className={styles.featureSvg} />
78      </div>
79      <div className="text--center padding-horiz--md">
80        <h3>{title}</h3>
81        <p>{description}</p>
82      </div>
83    </div>
84  );
85}
86
87export default function HomepageFeatures() {
88  return (
89    <section className={styles.features}>
90      <div className="container">
91        <div className="row">
92          {FeatureListSvg.map((props, idx) => (
93            <FeatureSvg key={idx} {...props} />
94          ))}
95          {FeatureListPng.map((props, idx) => (
96            <FeaturePng key={idx} {...props} />
97          ))}
98        </div>
99      </div>
100    </section>
101  );
102}
103