Remove unused imports and code from project/src/App.tsx
Some checks failed
Build and Push Docker Images / docker (push) Failing after 2m4s

Removed unused imports and state variables that were causing TypeScript build errors:
- Removed YachtSearch import (not used)
- Removed calculateTripCarbon import (not used)
- Removed getVesselData import (only used in unused handleSearch)
- Removed CarbonCalculation type import (not used)
- Removed unused state variables: loading, error, vesselData
- Removed unused handleSearch function

This fixes the Docker build failure: 'YachtSearch' is declared but its value is never read.
This commit is contained in:
Matt 2025-11-02 13:03:35 +01:00
parent 98e5b5e633
commit fdffb62220

View File

@ -2,16 +2,13 @@ import { useState, useEffect } from 'react';
import { Bird, Menu, X } from 'lucide-react'; import { Bird, Menu, X } from 'lucide-react';
import { motion, AnimatePresence } from 'framer-motion'; import { motion, AnimatePresence } from 'framer-motion';
import { Home } from './components/Home'; import { Home } from './components/Home';
import { YachtSearch } from './components/YachtSearch';
import { TripCalculator } from './components/TripCalculator'; import { TripCalculator } from './components/TripCalculator';
import { HowItWorks } from './components/HowItWorks'; import { HowItWorks } from './components/HowItWorks';
import { About } from './components/About'; import { About } from './components/About';
import { Contact } from './components/Contact'; import { Contact } from './components/Contact';
import { OffsetOrder } from './components/OffsetOrder'; import { OffsetOrder } from './components/OffsetOrder';
import { getVesselData } from './api/aisClient';
import { calculateTripCarbon } from './utils/carbonCalculator';
import { analytics } from './utils/analytics'; import { analytics } from './utils/analytics';
import type { VesselData, CarbonCalculation, CalculatorType } from './types'; import type { VesselData, CalculatorType } from './types';
const sampleVessel: VesselData = { const sampleVessel: VesselData = {
imo: "1234567", imo: "1234567",
@ -23,9 +20,6 @@ const sampleVessel: VesselData = {
}; };
function App() { function App() {
const [loading, setLoading] = useState(false);
const [error, setError] = useState<string | null>(null);
const [vesselData, setVesselData] = useState<VesselData | null>(null);
const [currentPage, setCurrentPage] = useState<'home' | 'calculator' | 'how-it-works' | 'about' | 'contact'>('home'); const [currentPage, setCurrentPage] = useState<'home' | 'calculator' | 'how-it-works' | 'about' | 'contact'>('home');
const [showOffsetOrder, setShowOffsetOrder] = useState(false); const [showOffsetOrder, setShowOffsetOrder] = useState(false);
const [offsetTons, setOffsetTons] = useState(0); const [offsetTons, setOffsetTons] = useState(0);
@ -37,21 +31,6 @@ function App() {
analytics.pageView(window.location.pathname); analytics.pageView(window.location.pathname);
}, [currentPage]); }, [currentPage]);
const handleSearch = async (imo: string) => {
setLoading(true);
setError(null);
setVesselData(null);
try {
const vessel = await getVesselData(imo);
setVesselData(vessel);
} catch (err) {
setError('Unable to fetch vessel data. Please verify the IMO number and try again.');
} finally {
setLoading(false);
}
};
const handleOffsetClick = (tons: number, monetaryAmount?: number) => { const handleOffsetClick = (tons: number, monetaryAmount?: number) => {
setOffsetTons(tons); setOffsetTons(tons);
setMonetaryAmount(monetaryAmount); setMonetaryAmount(monetaryAmount);