Skip to content
This repository was archived by the owner on Sep 14, 2022. It is now read-only.

Commit 3e9acd1

Browse files
committed
feat: add ParserOptions component
1 parent 9c6115d commit 3e9acd1

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

src/components/ParserOptions.tsx

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import React from "react";
2+
import type { FC } from "react";
3+
import { Row, Col } from "react-bootstrap";
4+
import { ECMA_VERSIONS, ECMA_FEATURES } from "@/components/constants";
5+
6+
interface Props {
7+
ecmaVersion: typeof ECMA_VERSIONS[number];
8+
ecmaFeatures: typeof ECMA_FEATURES[number];
9+
}
10+
11+
export const ParserOptions: FC<Props> = (props) => {
12+
return (
13+
<>
14+
<Row>
15+
<Col md={4}>
16+
<label htmlFor="ecmaVersion"> ECMA Version </label>
17+
</Col>
18+
<Col md={8}>
19+
<select id="ecmaVersion">
20+
{ECMA_VERSIONS.map((version) => (
21+
<option value={version} key={version}>
22+
{version}
23+
</option>
24+
))}
25+
</select>
26+
</Col>
27+
</Row>
28+
<Row>
29+
<Col md={4}>
30+
<label htmlFor="ecmaVersion"> ECMA Features </label>
31+
</Col>
32+
<Col md={8}>
33+
{ECMA_FEATURES.map((ecmaFeature) => (
34+
<div className="checkbox" key={ecmaFeature}>
35+
<label htmlFor={ecmaFeature}>
36+
<input
37+
type="checkbox"
38+
className="option-checkbox"
39+
id={ecmaFeature}
40+
/>
41+
{ecmaFeature}
42+
</label>
43+
</div>
44+
))}
45+
</Col>
46+
</Row>
47+
</>
48+
);
49+
};

0 commit comments

Comments
 (0)