Add Prettier for TypeScript formatting
- Install prettier - Configure .prettierrc.json and .prettierignore - Add npm scripts: format, format:check - Add Makefile target: format-frontend - Format all frontend files
This commit is contained in:
parent
4b394b0698
commit
37de6f70e0
44 changed files with 906 additions and 856 deletions
|
|
@ -21,7 +21,7 @@ export default function SumPage() {
|
|||
const numA = parseFloat(a) || 0;
|
||||
const numB = parseFloat(b) || 0;
|
||||
setError(null);
|
||||
|
||||
|
||||
try {
|
||||
const data = await api.post<{ result: number }>("/api/sum", { a: numA, b: numB });
|
||||
setResult(data.result);
|
||||
|
|
@ -58,7 +58,7 @@ export default function SumPage() {
|
|||
<div style={styles.content}>
|
||||
<div style={styles.card}>
|
||||
<span style={styles.label}>Sum Calculator</span>
|
||||
|
||||
|
||||
{!showResult ? (
|
||||
<div style={styles.inputSection}>
|
||||
<div style={styles.inputRow}>
|
||||
|
|
@ -84,17 +84,11 @@ export default function SumPage() {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
onClick={handleSum}
|
||||
style={styles.sumBtn}
|
||||
disabled={a === "" && b === ""}
|
||||
>
|
||||
<button onClick={handleSum} style={styles.sumBtn} disabled={a === "" && b === ""}>
|
||||
<span style={styles.equalsIcon}>=</span>
|
||||
Calculate
|
||||
</button>
|
||||
{error && (
|
||||
<div style={styles.error}>{error}</div>
|
||||
)}
|
||||
{error && <div style={styles.error}>{error}</div>}
|
||||
</div>
|
||||
) : (
|
||||
<div style={styles.resultSection}>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue