mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-11 16:52:38 +02:00
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:
parent
c41e79860f
commit
323788e9a3
1 changed files with 3 additions and 3 deletions
|
|
@ -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 ?? [
|
const p = pattern ?? [
|
||||||
[9, 3],
|
[9, 3],
|
||||||
[8, 5],
|
[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();
|
const patternId = useId();
|
||||||
|
|
||||||
return (
|
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})`} />
|
<rect width="100%" height="100%" strokeWidth={0} fill={`url(#${patternId})`} />
|
||||||
{squares && (
|
{squares && (
|
||||||
<svg aria-hidden="true" x={x} y={y} className="overflow-visible">
|
<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
|
<rect
|
||||||
strokeWidth="0"
|
strokeWidth="0"
|
||||||
key={`${x}-${y}-${idx}`}
|
key={`${x}-${y}-${idx}`}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue