Skip to content

Commit cb3eada

Browse files
committed
refactor: split react component into several files
1 parent bf344c4 commit cb3eada

22 files changed

+1384
-1218
lines changed

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Ignore artifacts:
2+
build
3+
coverage

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"useTabs": true,
3+
"tabWidth": 2,
4+
"semi": true,
5+
"singleQuote": false,
6+
"trailingComma": "es5"
7+
}

.vscode/settings.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"editor.insertSpaces": false,
3+
"editor.tabSize": 2,
4+
"editor.detectIndentation": false,
5+
"editor.defaultFormatter": "esbenp.prettier-vscode",
6+
"[typescriptreact]": {
7+
"editor.defaultFormatter": "esbenp.prettier-vscode"
8+
}
9+
}

eslint.config.mjs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ import nextVitals from "eslint-config-next/core-web-vitals";
33
import nextTs from "eslint-config-next/typescript";
44

55
const eslintConfig = defineConfig([
6-
...nextVitals,
7-
...nextTs,
8-
// Override default ignores of eslint-config-next.
9-
globalIgnores([
10-
// Default ignores of eslint-config-next:
11-
".next/**",
12-
"out/**",
13-
"build/**",
14-
"next-env.d.ts",
15-
]),
6+
...nextVitals,
7+
...nextTs,
8+
// Override default ignores of eslint-config-next.
9+
globalIgnores([
10+
// Default ignores of eslint-config-next:
11+
".next/**",
12+
"out/**",
13+
"build/**",
14+
"next-env.d.ts",
15+
]),
1616
]);
1717

1818
export default eslintConfig;

next.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { NextConfig } from "next";
22

33
const nextConfig: NextConfig = {
4-
/* config options here */
4+
/* config options here */
55
};
66

77
export default nextConfig;

package.json

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
{
2-
"name": "paper-paraphraser",
3-
"version": "0.1.0",
4-
"private": true,
5-
"scripts": {
6-
"dev": "next dev",
7-
"build": "next build",
8-
"start": "next start",
9-
"lint": "eslint"
10-
},
11-
"dependencies": {
12-
"lucide-react": "^0.562.0",
13-
"next": "16.1.1",
14-
"react": "19.2.3",
15-
"react-dom": "19.2.3"
16-
},
17-
"devDependencies": {
18-
"@tailwindcss/postcss": "^4",
19-
"@types/node": "^20",
20-
"@types/react": "^19",
21-
"@types/react-dom": "^19",
22-
"eslint": "^9",
23-
"eslint-config-next": "16.1.1",
24-
"prettier": "3.7.4",
25-
"tailwindcss": "^4",
26-
"typescript": "^5"
27-
}
2+
"name": "paper-paraphraser",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"dev": "next dev",
7+
"build": "next build",
8+
"start": "next start",
9+
"lint": "eslint"
10+
},
11+
"dependencies": {
12+
"lucide-react": "^0.562.0",
13+
"next": "16.1.1",
14+
"react": "19.2.3",
15+
"react-dom": "19.2.3"
16+
},
17+
"devDependencies": {
18+
"@tailwindcss/postcss": "^4",
19+
"@types/node": "^20",
20+
"@types/react": "^19",
21+
"@types/react-dom": "^19",
22+
"eslint": "^9",
23+
"eslint-config-next": "16.1.1",
24+
"prettier": "3.7.4",
25+
"tailwindcss": "^4",
26+
"typescript": "^5"
27+
}
2828
}

postcss.config.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const config = {
2-
plugins: {
3-
"@tailwindcss/postcss": {},
4-
},
2+
plugins: {
3+
"@tailwindcss/postcss": {},
4+
},
55
};
66

77
export default config;

src/app/_components/AnalyzeButton.tsx

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,39 @@
33
import { Search, Loader2 } from "lucide-react";
44

55
export default function AnalyzeButton({
6-
onClick,
7-
disabled,
8-
isLoading,
6+
onClick,
7+
disabled,
8+
isLoading,
99
}: {
10-
onClick: () => void;
11-
disabled: boolean;
12-
isLoading: boolean;
10+
onClick: () => void;
11+
disabled: boolean;
12+
isLoading: boolean;
1313
}) {
14-
return (
15-
<div className="mb-8 text-center">
16-
<button
17-
onClick={onClick}
18-
disabled={disabled || isLoading}
19-
className="clay-button btn-primary text-lg px-8 py-4 font-semibold min-w-[240px]"
20-
>
21-
{isLoading ? (
22-
<>
23-
<Loader2 className="w-5 h-5 animate-spin" />
24-
Analyzing...
25-
</>
26-
) : (
27-
<>
28-
<Search className="w-5 h-5" />
29-
Analyze Document
30-
</>
31-
)}
32-
</button>
14+
return (
15+
<div className="mb-8 text-center">
16+
<button
17+
onClick={onClick}
18+
disabled={disabled || isLoading}
19+
className="clay-button btn-primary text-lg px-8 py-4 font-semibold min-w-[240px]"
20+
>
21+
{isLoading ? (
22+
<>
23+
<Loader2 className="w-5 h-5 animate-spin" />
24+
Analyzing...
25+
</>
26+
) : (
27+
<>
28+
<Search className="w-5 h-5" />
29+
Analyze Document
30+
</>
31+
)}
32+
</button>
3333

34-
{disabled && !isLoading && (
35-
<p className="font-inter text-sm text-text-tertiary mt-2 mb-0">
36-
Please submit a document to analyze
37-
</p>
38-
)}
39-
</div>
40-
);
34+
{disabled && !isLoading && (
35+
<p className="font-inter text-sm text-text-tertiary mt-2 mb-0">
36+
Please submit a document to analyze
37+
</p>
38+
)}
39+
</div>
40+
);
4141
}

0 commit comments

Comments
 (0)