fixed type errors

This commit is contained in:
2025-09-16 14:20:38 +01:00
parent c506c395e6
commit b98e3ed85d
21 changed files with 161 additions and 130 deletions

View File

@@ -1,11 +1,11 @@
import { useEffect } from "react";
import type { SightingWidgetType } from "../types/types";
import type { SightingType } from "../types/types";
import { drawRects } from "../utils/utils";
type Mode = 0 | 1 | 2;
export function useOverviewOverlay(
selected: SightingWidgetType | null | undefined,
selected: SightingType | null | undefined,
overlayMode: Mode,
imgRef: React.RefObject<HTMLImageElement | null>,
canvasRef: React.RefObject<HTMLCanvasElement | null>

View File

@@ -1,19 +1,16 @@
import { useEffect, useRef, useState } from "react";
import type { SightingType, SightingWidgetType } from "../types/types";
import type { SightingType } from "../types/types";
async function fetchSighting(
url: string,
ref: number
): Promise<SightingWidgetType> {
async function fetchSighting(url: string, ref: number): Promise<SightingType> {
const res = await fetch(`${url}${ref}`);
if (!res.ok) throw new Error(String(res.status));
return await res.json();
}
export function useSightingFeed(url: string) {
const [sightings, setSightings] = useState<SightingWidgetType[]>([]);
const [sightings, setSightings] = useState<SightingType[]>([]);
const [selectedRef, setSelectedRef] = useState<number | null>(null);
const [mostRecent, setMostRecent] = useState<SightingWidgetType | null>(null);
const [mostRecent, setMostRecent] = useState<SightingType | null>(null);
const [selectedSighting, setSelectedSighting] = useState<SightingType | null>(
null
);

View File

@@ -27,6 +27,6 @@ export const useSystemConfig = () => {
return {
uploadSettings: uploadSettingsMutation.mutate,
saveSystemSettings: saveSystemSettings.mutate,
getSystemSettingsData: getSystemSettings.data,
systemSettingsData: getSystemSettings.data,
};
};