refactor: import React types directly instead of namespace
Replace 'import React from "react"' with direct imports of CSSProperties and ChangeEvent. This eliminates unused imports and follows modern React patterns where the namespace import is not required for JSX (React 17+).
This commit is contained in:
parent
c9c36971d8
commit
e8d0ee2eca
5 changed files with 11 additions and 14 deletions
|
|
@ -1,7 +1,6 @@
|
|||
"use client";
|
||||
|
||||
import React from "react";
|
||||
import { useEffect, useState, useCallback, useMemo } from "react";
|
||||
import { useEffect, useState, useCallback, useMemo, ChangeEvent, CSSProperties } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { Permission } from "../auth-context";
|
||||
import { api } from "../api";
|
||||
|
|
@ -221,7 +220,7 @@ export default function ExchangePage() {
|
|||
setEurAmount(clamped);
|
||||
};
|
||||
|
||||
const handleAmountInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
const handleAmountInputChange = (e: ChangeEvent<HTMLInputElement>) => {
|
||||
const inputValue = e.target.value.replace(/[^0-9]/g, "");
|
||||
if (inputValue === "") {
|
||||
setEurAmount(eurMin * 100);
|
||||
|
|
@ -599,7 +598,7 @@ export default function ExchangePage() {
|
|||
}
|
||||
|
||||
// Page-specific styles
|
||||
const styles: Record<string, React.CSSProperties> = {
|
||||
const styles: Record<string, CSSProperties> = {
|
||||
content: {
|
||||
flex: 1,
|
||||
padding: "2rem",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue