Fix types and imports across the board
This commit is contained in:
@@ -3,8 +3,8 @@ import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
|
||||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
||||
import { Toaster } from "@/components/ui/toaster";
|
||||
import Index from "./pages/Index";
|
||||
import RegionPage from "./pages/RegionPage";
|
||||
import SystemView from "./pages/SystemView";
|
||||
import { RegionPage } from "./pages/RegionPage";
|
||||
import { SystemView } from "./pages/SystemView";
|
||||
import NotFound from "./pages/NotFound";
|
||||
import "./App.css";
|
||||
|
||||
|
@@ -21,5 +21,3 @@ export const CleanModeToggle = ({ cleanMode, onToggle }: CleanModeToggleProps) =
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default CleanModeToggle;
|
||||
|
@@ -57,5 +57,3 @@ export const Header = ({ title, breadcrumbs = [] }: HeaderProps) => {
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Header;
|
||||
|
@@ -324,5 +324,3 @@ export const RegionMap = ({ regionName, focusSystem, isCompact = false }: Region
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default RegionMap;
|
||||
|
@@ -2,22 +2,13 @@
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Zap, Shield, Coins, HelpCircle } from "lucide-react";
|
||||
|
||||
interface SignatureItem {
|
||||
collectionId: string;
|
||||
collectionName: string;
|
||||
id: string;
|
||||
signame: string;
|
||||
sysid: string;
|
||||
system: string;
|
||||
type: string;
|
||||
}
|
||||
import { Signature } from "./SystemTracker";
|
||||
|
||||
interface SignatureCardProps {
|
||||
signature: SignatureItem;
|
||||
signature: Signature;
|
||||
}
|
||||
|
||||
const SignatureCard = ({ signature }: SignatureCardProps) => {
|
||||
export const SignatureCard = ({ signature }: SignatureCardProps) => {
|
||||
const getTypeIcon = (type: string) => {
|
||||
const lowerType = type.toLowerCase();
|
||||
if (lowerType.includes('combat')) return <Zap className="h-4 w-4" />;
|
||||
@@ -73,5 +64,3 @@ const SignatureCard = ({ signature }: SignatureCardProps) => {
|
||||
</Card>
|
||||
);
|
||||
};
|
||||
|
||||
export default SignatureCard;
|
||||
|
@@ -1,25 +1,12 @@
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Zap, Shield, Coins, HelpCircle, Clock, AlertTriangle, Skull } from "lucide-react";
|
||||
|
||||
interface SignatureItem {
|
||||
collectionId: string;
|
||||
collectionName: string;
|
||||
id: string;
|
||||
identifier: string;
|
||||
signame: string;
|
||||
sysid: string;
|
||||
system: string;
|
||||
type: string;
|
||||
updated?: string;
|
||||
created?: string;
|
||||
dangerous?: boolean;
|
||||
}
|
||||
import { Signature } from "@/components/SystemTracker";
|
||||
|
||||
interface SignatureListItemProps {
|
||||
signature: SignatureItem;
|
||||
signature: Signature;
|
||||
}
|
||||
|
||||
const SignatureListItem = ({ signature }: SignatureListItemProps) => {
|
||||
export const SignatureListItem = ({ signature }: SignatureListItemProps) => {
|
||||
const getTypeIcon = (type: string) => {
|
||||
const lowerType = type.toLowerCase();
|
||||
if (lowerType.includes("combat")) return <Zap className="h-4 w-4" />;
|
||||
@@ -80,9 +67,8 @@ const SignatureListItem = ({ signature }: SignatureListItemProps) => {
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`flex items-center justify-between p-4 border-b border-slate-700 hover:bg-slate-800/40 transition-colors ${
|
||||
oldEntry ? "opacity-50" : ""
|
||||
}`}
|
||||
className={`flex items-center justify-between p-4 border-b border-slate-700 hover:bg-slate-800/40 transition-colors ${oldEntry ? "opacity-50" : ""
|
||||
}`}
|
||||
>
|
||||
<div className="flex items-center gap-4 flex-1">
|
||||
{/* Type Badge - Most Important */}
|
||||
@@ -132,5 +118,3 @@ const SignatureListItem = ({ signature }: SignatureListItemProps) => {
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default SignatureListItem;
|
||||
|
@@ -5,13 +5,13 @@ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { RefreshCw, AlertCircle, Radar } from "lucide-react";
|
||||
import SignatureListItem from "./SignatureListItem";
|
||||
import { SignatureListItem } from "@/components/SignatureListItem";
|
||||
import { toast } from "@/hooks/use-toast";
|
||||
|
||||
interface SignatureItem {
|
||||
collectionId: string;
|
||||
collectionName: string;
|
||||
id: string;
|
||||
export interface Signature {
|
||||
collectionId?: string;
|
||||
collectionName?: string;
|
||||
id?: string;
|
||||
identifier: string;
|
||||
signame: string;
|
||||
sysid: string;
|
||||
@@ -20,20 +20,18 @@ interface SignatureItem {
|
||||
updated?: string;
|
||||
created?: string;
|
||||
dangerous?: boolean;
|
||||
scanned?: string;
|
||||
}
|
||||
|
||||
interface ApiResponse {
|
||||
items: SignatureItem[];
|
||||
items: Signature[];
|
||||
}
|
||||
|
||||
interface SystemTrackerProps {
|
||||
system: string;
|
||||
}
|
||||
|
||||
const SystemTracker = ({ system }: SystemTrackerProps) => {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
// Query to get signatures for the current system with polling
|
||||
export const SystemTracker = ({ system }: SystemTrackerProps) => {
|
||||
const {
|
||||
data: signaturesData,
|
||||
refetch: refetchSignatures,
|
||||
@@ -178,5 +176,3 @@ const SystemTracker = ({ system }: SystemTrackerProps) => {
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default SystemTracker;
|
||||
|
@@ -1,6 +1,5 @@
|
||||
|
||||
import { GalaxyMap } from '../components/GalaxyMap';
|
||||
import Header from '../components/Header';
|
||||
import { Header } from '../components/Header';
|
||||
|
||||
const Index = () => {
|
||||
return (
|
||||
|
@@ -5,7 +5,7 @@ import { Button } from '@/components/ui/button';
|
||||
import { ArrowLeft } from 'lucide-react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
|
||||
const RegionPage = () => {
|
||||
export const RegionPage = () => {
|
||||
const { region } = useParams<{ region: string }>();
|
||||
const navigate = useNavigate();
|
||||
|
||||
@@ -29,5 +29,3 @@ const RegionPage = () => {
|
||||
|
||||
return <RegionMap regionName={region} />;
|
||||
};
|
||||
|
||||
export default RegionPage;
|
||||
|
@@ -10,18 +10,9 @@ import { Header } from "@/components/Header";
|
||||
import { parseSignature, parseScannedPercentage } from "@/utils/signatureParser";
|
||||
import { getSystemId } from "@/utils/systemApi";
|
||||
import pb from "@/lib/pocketbase";
|
||||
import { Signature } from "@/components/SystemTracker";
|
||||
|
||||
interface Signature {
|
||||
identifier: string;
|
||||
type: string;
|
||||
name: string;
|
||||
system: string;
|
||||
sysid: string;
|
||||
dangerous?: boolean;
|
||||
scanned?: string;
|
||||
}
|
||||
|
||||
const SystemView = () => {
|
||||
export const SystemView = () => {
|
||||
const { system, region } = useParams();
|
||||
const navigate = useNavigate();
|
||||
const queryClient = useQueryClient();
|
||||
@@ -48,7 +39,7 @@ const SystemView = () => {
|
||||
|
||||
if (newScannedPercentage > existingScannedPercentage) {
|
||||
await pb.collection('signature').update(existingRecord.id, {
|
||||
name: signature.name,
|
||||
name: signature.signame,
|
||||
type: signature.type,
|
||||
dangerous: signature.dangerous,
|
||||
scanned: signature.scanned
|
||||
@@ -62,7 +53,7 @@ const SystemView = () => {
|
||||
await pb.collection('signature').create({
|
||||
system: signature.system,
|
||||
identifier: signature.identifier,
|
||||
name: signature.name,
|
||||
name: signature.signame,
|
||||
type: signature.type,
|
||||
dangerous: signature.dangerous,
|
||||
scanned: signature.scanned
|
||||
@@ -224,5 +215,3 @@ const SystemView = () => {
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default SystemView;
|
||||
|
@@ -1,13 +1,4 @@
|
||||
|
||||
interface Signature {
|
||||
identifier: string;
|
||||
type: string;
|
||||
name: string;
|
||||
system: string;
|
||||
sysid: string;
|
||||
dangerous?: boolean;
|
||||
scanned?: string;
|
||||
}
|
||||
import { Signature } from "@/components/SystemTracker";
|
||||
|
||||
export const parseSignature = (text: string): Omit<Signature, 'system' | 'sysid'> | null => {
|
||||
const parts = text.split('\t');
|
||||
@@ -22,7 +13,7 @@ export const parseSignature = (text: string): Omit<Signature, 'system' | 'sysid'
|
||||
return {
|
||||
identifier: parts[0],
|
||||
type: parts[2],
|
||||
name: parts[3],
|
||||
signame: parts[3],
|
||||
scanned: parts.length > 4 ? parts[4] : undefined,
|
||||
dangerous: false // TODO: Implement dangerous signature detection
|
||||
};
|
||||
|
Reference in New Issue
Block a user