fixed type errors
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
@@ -27,6 +27,6 @@ export const useSystemConfig = () => {
|
||||
return {
|
||||
uploadSettings: uploadSettingsMutation.mutate,
|
||||
saveSystemSettings: saveSystemSettings.mutate,
|
||||
getSystemSettingsData: getSystemSettings.data,
|
||||
systemSettingsData: getSystemSettings.data,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user