fix: replace any types with proper types in contact form component

- Replace `any` props type with `React.ComponentProps<"svg">` plus explicit named props
- Replace `any` tuple type with `[number, number]` in squares mapper

Closes #912
This commit is contained in:
likiosliu 2026-03-24 19:51:29 +08:00
parent c41e79860f
commit 323788e9a3

View file

@ -161,7 +161,7 @@ export const FeatureIconContainer = ({
);
};
export const Grid = ({ pattern, size }: { pattern?: number[][]; size?: number }) => {
export const Grid = ({ pattern, size }: { pattern?: [number, number][]; size?: number }) => {
const p = pattern ?? [
[9, 3],
[8, 5],
@ -185,7 +185,7 @@ export const Grid = ({ pattern, size }: { pattern?: number[][]; size?: number })
);
};
export function GridPattern({ width, height, x, y, squares, ...props }: any) {
export function GridPattern({ width, height, x, y, squares, ...props }: React.ComponentProps<"svg"> & { width: number; height: number; x: string | number; y: string | number; squares?: [number, number][] }) {
const patternId = useId();
return (
@ -205,7 +205,7 @@ export function GridPattern({ width, height, x, y, squares, ...props }: any) {
<rect width="100%" height="100%" strokeWidth={0} fill={`url(#${patternId})`} />
{squares && (
<svg aria-hidden="true" x={x} y={y} className="overflow-visible">
{squares.map(([x, y]: any, idx: number) => (
{squares.map(([x, y]: [number, number], idx: number) => (
<rect
strokeWidth="0"
key={`${x}-${y}-${idx}`}