Passed
Push — main ( 7326d1...81594a )
by LCS
03:20
created

App.tsx ➔ ErrorButton   A

Complexity

Conditions 1

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 10
c 0
b 0
f 0
rs 10
cc 1
1
import React from "react";
2
import ErrorButton from "./components/ErrorButton";
3
import ToolCard from "./components/ToolCard";
4
import Calculator from "./tools/Calculator";
5
import PasswordGenerator from "./tools/PasswordGenerator";
6
import QRGenerator from "./tools/QRGenerator";
7
import UnitConverter from "./tools/UnitConverter";
8
9
const tools = [
10
  { name: "Calculator", component: <Calculator /> },
11
  { name: "Password Generator", component: <PasswordGenerator /> },
12
  { name: "QR Code Generator", component: <QRGenerator /> },
13
  { name: "Unit Converter", component: <UnitConverter /> },
14
];
15
16
export default function App() {
17
  return (
18
    <main className="tool-grid">
19
      {tools.map((tool) => (
20
        <ToolCard key={tool.name} name={tool.name} content={tool.component} />
21
      ))}
22
    </main>
23
  );
24
}
25
26
export default function ErrorButton() {
27
  return (
28
    <button
29
      onClick={() => {
30
        throw new Error("This is your first error!");
31
      }}
32
    >
33
      Break the world
34
    </button>
35
  );
36
}