Fix compilation errors and resolve ESLint warnings across multiple components
This commit is contained in:
@@ -79,7 +79,7 @@ const BusinessDescriptionStep: React.FC<BusinessDescriptionStepProps> = ({ onBac
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const [success, setSuccess] = useState<string | null>(null);
|
||||
const [showExamples, setShowExamples] = useState(false);
|
||||
// const [showExamples, setShowExamples] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
console.log('🔄 BusinessDescriptionStep mounted. Loading cached data...');
|
||||
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
Divider,
|
||||
Chip,
|
||||
Tooltip,
|
||||
IconButton,
|
||||
// IconButton,
|
||||
Collapse
|
||||
} from '@mui/material';
|
||||
import {
|
||||
@@ -99,7 +99,7 @@ const CompetitorAnalysisStep: React.FC<CompetitorAnalysisStepProps> = ({
|
||||
const [isAnalyzingSitemap, setIsAnalyzingSitemap] = useState(false);
|
||||
const [isDiscoveringSocial, setIsDiscoveringSocial] = useState(false);
|
||||
const [showHeaderInfo, setShowHeaderInfo] = useState(false);
|
||||
const [showWhyImportant, setShowWhyImportant] = useState(false);
|
||||
// const [showWhyImportant, setShowWhyImportant] = useState(false);
|
||||
const [missingData, setMissingData] = useState(false);
|
||||
|
||||
// Ref to track if initialization has already started to prevent duplicate calls
|
||||
@@ -399,7 +399,7 @@ const CompetitorAnalysisStep: React.FC<CompetitorAnalysisStepProps> = ({
|
||||
} finally {
|
||||
setIsDiscoveringSocial(false);
|
||||
}
|
||||
}, [userUrl, isDiscoveringSocial]);
|
||||
}, [userUrl, isDiscoveringSocial, socialMediaAccounts]);
|
||||
|
||||
// Sitemap Analysis Function
|
||||
const startSitemapAnalysis = useCallback(async (force = false) => {
|
||||
|
||||
@@ -44,7 +44,7 @@ export const ComingSoonSection: React.FC<{ missingData?: boolean }> = ({ missing
|
||||
const [strategicInsightsRunning, setStrategicInsightsRunning] = useState(false);
|
||||
const [strategicInsightsError, setStrategicInsightsError] = useState<string | null>(null);
|
||||
const [strategicInsightsData, setStrategicInsightsData] = useState<any>(null);
|
||||
const [loadingStrategicHistory, setLoadingStrategicHistory] = useState(false);
|
||||
// const [loadingStrategicHistory, setLoadingStrategicHistory] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
const loadStatus = async () => {
|
||||
@@ -62,7 +62,7 @@ export const ComingSoonSection: React.FC<{ missingData?: boolean }> = ({ missing
|
||||
};
|
||||
|
||||
const loadHistory = async () => {
|
||||
setLoadingStrategicHistory(true);
|
||||
// setLoadingStrategicHistory(true);
|
||||
try {
|
||||
const res = await apiClient.get('/api/seo-dashboard/strategic-insights/history');
|
||||
if (res.data?.history?.length > 0) {
|
||||
@@ -71,7 +71,7 @@ export const ComingSoonSection: React.FC<{ missingData?: boolean }> = ({ missing
|
||||
} catch (e) {
|
||||
console.error("Failed to fetch strategic insights history", e);
|
||||
} finally {
|
||||
setLoadingStrategicHistory(false);
|
||||
// setLoadingStrategicHistory(false);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -130,12 +130,12 @@ export const SitemapBenchmarkResults: React.FC<Props> = ({ data }) => {
|
||||
: 0;
|
||||
|
||||
const MetricCard = ({ title, userValue, competitorValue, icon, unit = '', description }: any) => {
|
||||
const isBelowAvg = userValue < competitorValue;
|
||||
// const isBelowAvg = userValue < competitorValue;
|
||||
|
||||
return (
|
||||
<Card
|
||||
elevation={0}
|
||||
sx={{
|
||||
sx={{
|
||||
height: '100%',
|
||||
border: `1px solid #e2e8f0`,
|
||||
borderRadius: 3,
|
||||
|
||||
@@ -12,8 +12,8 @@ import {
|
||||
Button,
|
||||
List,
|
||||
ListItem,
|
||||
ListItemIcon,
|
||||
ListItemText,
|
||||
// ListItemIcon,
|
||||
// ListItemText,
|
||||
Divider,
|
||||
Avatar
|
||||
} from '@mui/material';
|
||||
@@ -66,7 +66,6 @@ export interface Props {
|
||||
}
|
||||
|
||||
export const StrategicInsightsResults: React.FC<Props> = ({ report, hideCreateContent = false }) => {
|
||||
const theme = useTheme();
|
||||
const { insights, metrics, week_commencing } = report;
|
||||
|
||||
const handleCreateContent = (topic: string) => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useState, useEffect, useRef } from 'react';
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import {
|
||||
Box,
|
||||
Button,
|
||||
@@ -13,10 +13,10 @@ import {
|
||||
Rocket,
|
||||
Star,
|
||||
CheckCircle,
|
||||
CreditCard,
|
||||
Warning
|
||||
// CreditCard,
|
||||
// Warning
|
||||
} from '@mui/icons-material';
|
||||
import OnboardingButton from '../common/OnboardingButton';
|
||||
// import OnboardingButton from '../common/OnboardingButton';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { getApiKeys, completeOnboarding, getOnboardingSummary, getWebsiteAnalysisData, getResearchPreferencesData, setCurrentStep } from '../../../api/onboarding';
|
||||
import { SetupSummary, CapabilitiesOverview, AgentTeamSection } from './components';
|
||||
@@ -35,7 +35,7 @@ const FinalStep: React.FC<FinalStepProps> = ({ onContinue, updateHeaderContent }
|
||||
const [validationStatus, setValidationStatus] = useState<{isValid: boolean, missingSteps: string[]} | null>(null);
|
||||
const [agentTeam, setAgentTeam] = useState<AgentTeamCatalogEntry[]>([]);
|
||||
const [agentTeamError, setAgentTeamError] = useState<string | null>(null);
|
||||
const buttonRef = useRef<HTMLButtonElement>(null);
|
||||
// const buttonRef = useRef<HTMLButtonElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
updateHeaderContent({
|
||||
@@ -44,6 +44,7 @@ const FinalStep: React.FC<FinalStepProps> = ({ onContinue, updateHeaderContent }
|
||||
});
|
||||
// Always attempt to load data once on mount
|
||||
loadOnboardingData();
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [updateHeaderContent]);
|
||||
|
||||
// Remove the DOM manipulation approach - we'll use React's built-in event handling
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
RadioGroup,
|
||||
FormControlLabel,
|
||||
FormControl,
|
||||
FormLabel,
|
||||
// FormLabel,
|
||||
Card,
|
||||
CardContent,
|
||||
Alert,
|
||||
@@ -18,8 +18,8 @@ import {
|
||||
} from '@mui/material';
|
||||
import {
|
||||
ArrowForward as ArrowForwardIcon,
|
||||
ExpandMore as ExpandMoreIcon,
|
||||
ExpandLess as ExpandLessIcon,
|
||||
// ExpandMore as ExpandMoreIcon,
|
||||
// ExpandLess as ExpandLessIcon,
|
||||
PlayArrow as PlayArrowIcon,
|
||||
// Social Media Icons
|
||||
Facebook as FacebookIcon,
|
||||
@@ -39,7 +39,7 @@ import {
|
||||
AutoAwesome as AutoAwesomeIcon,
|
||||
Lightbulb as LightbulbIcon,
|
||||
CheckCircle as CheckCircleIcon,
|
||||
Error as ErrorIcon
|
||||
// Error as ErrorIcon
|
||||
} from '@mui/icons-material';
|
||||
import { motion } from 'framer-motion';
|
||||
|
||||
@@ -89,7 +89,7 @@ const IntegrationsStep: React.FC<IntegrationsStepProps> = ({ onContinue, updateH
|
||||
}, []);
|
||||
|
||||
// Force refresh analytics data (bypass cache)
|
||||
const forceRefreshAnalytics = useCallback(async () => {
|
||||
/* const forceRefreshAnalytics = useCallback(async () => {
|
||||
try {
|
||||
// Clear all cache first
|
||||
cachedAnalyticsAPI.clearCache();
|
||||
@@ -103,7 +103,7 @@ const IntegrationsStep: React.FC<IntegrationsStepProps> = ({ onContinue, updateH
|
||||
} catch (error) {
|
||||
console.error('IntegrationsStep: Error force refreshing analytics:', error);
|
||||
}
|
||||
}, []);
|
||||
}, []); */
|
||||
const { isLoading, showToast, setShowToast, toastMessage, handleConnect } = usePlatformConnections();
|
||||
|
||||
// WordPress OAuth hook
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
IconButton,
|
||||
Alert,
|
||||
Chip,
|
||||
Divider,
|
||||
// Divider,
|
||||
Modal,
|
||||
Fade,
|
||||
Backdrop,
|
||||
@@ -25,20 +25,18 @@ import {
|
||||
InputLabel,
|
||||
FormHelperText
|
||||
} from '@mui/material';
|
||||
import { keyframes } from '@mui/system';
|
||||
import {
|
||||
AutoAwesome,
|
||||
CloudUpload,
|
||||
Refresh,
|
||||
// // Refresh,
|
||||
PhotoCamera,
|
||||
AutoFixHigh,
|
||||
InfoOutlined,
|
||||
Close,
|
||||
PlayArrow,
|
||||
// PlayArrow,
|
||||
HelpOutline,
|
||||
Palette,
|
||||
// Palette,
|
||||
Psychology,
|
||||
AutoFixNormal,
|
||||
// AutoFixNormal,
|
||||
Create,
|
||||
CheckCircle,
|
||||
Fullscreen,
|
||||
@@ -70,11 +68,11 @@ import {
|
||||
|
||||
type GenerationMode = 'generate' | 'variation' | 'enhance';
|
||||
|
||||
const pulse = keyframes`
|
||||
/* const pulse = keyframes`
|
||||
0% { transform: scale(1); }
|
||||
50% { transform: scale(1.05); }
|
||||
100% { transform: scale(1); }
|
||||
`;
|
||||
`; */
|
||||
|
||||
export const BrandAvatarStudio: React.FC<{ domainName?: string; onAvatarSet?: () => void }> = ({ domainName, onAvatarSet }) => {
|
||||
const [mode, setMode] = useState<GenerationMode>('generate');
|
||||
|
||||
@@ -348,6 +348,7 @@ const WebsiteStep: React.FC<WebsiteStepProps> = ({ onContinue, updateHeaderConte
|
||||
setAnalysis(updatedAnalysis);
|
||||
};
|
||||
|
||||
/*
|
||||
const handleContinue = async () => {
|
||||
setError(null);
|
||||
const fixedUrl = fixUrlFormat(website);
|
||||
@@ -385,6 +386,17 @@ const WebsiteStep: React.FC<WebsiteStepProps> = ({ onContinue, updateHeaderConte
|
||||
|
||||
onContinue(stepData);
|
||||
};
|
||||
*/
|
||||
/*
|
||||
const handleContinue = async () => {
|
||||
// This function is now triggered by the user via the AnalysisResultsDisplay component
|
||||
// or manually via a button if we were to add one here.
|
||||
// Since AnalysisResultsDisplay has its own flow, we might not use this directly
|
||||
// in the main render unless we want a global "Continue" button.
|
||||
// For now, silencing the unused var warning by logging or commenting out.
|
||||
console.log('Main handleContinue ready');
|
||||
};
|
||||
*/
|
||||
|
||||
// Conditional rendering for business description form - now handled inline via toggle
|
||||
/*
|
||||
|
||||
@@ -15,10 +15,10 @@ import {
|
||||
FormControlLabel,
|
||||
Alert,
|
||||
Paper,
|
||||
List,
|
||||
ListItem,
|
||||
ListItemText,
|
||||
Link,
|
||||
// List,
|
||||
// ListItem,
|
||||
// ListItemText,
|
||||
// Link,
|
||||
Collapse,
|
||||
Switch,
|
||||
Button
|
||||
@@ -31,7 +31,7 @@ import {
|
||||
Business as BusinessIcon,
|
||||
Info as InfoIcon,
|
||||
Link as LinkIcon,
|
||||
Edit as EditIcon,
|
||||
// Edit as EditIcon,
|
||||
Save as SaveIcon,
|
||||
ExpandLess as ExpandLessIcon,
|
||||
ExpandMore as ExpandMoreIcon,
|
||||
@@ -40,7 +40,7 @@ import {
|
||||
|
||||
// Import rendering utilities
|
||||
import {
|
||||
renderProUpgradeAlert,
|
||||
// renderProUpgradeAlert,
|
||||
renderBestPracticesSection,
|
||||
renderAvoidElementsSection,
|
||||
renderBrandAnalysisSection
|
||||
|
||||
@@ -23,7 +23,6 @@ import {
|
||||
School as AuthorityIcon,
|
||||
Info as InfoIcon
|
||||
} from '@mui/icons-material';
|
||||
import SectionHeader from './SectionHeader';
|
||||
|
||||
interface BrandAnalysis {
|
||||
brand_voice: string;
|
||||
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
DialogContent,
|
||||
DialogActions,
|
||||
TextField,
|
||||
Tooltip
|
||||
// Tooltip
|
||||
} from '@mui/material';
|
||||
import {
|
||||
Business as BusinessIcon,
|
||||
@@ -75,12 +75,10 @@ const CompetitorsGrid: React.FC<CompetitorsGridProps> = ({
|
||||
}) => {
|
||||
const [openAddDialog, setOpenAddDialog] = useState(false);
|
||||
const [newCompetitorUrl, setNewCompetitorUrl] = useState('');
|
||||
const [isAdding, setIsAdding] = useState(false);
|
||||
|
||||
const handleAddSubmit = async () => {
|
||||
const handleAddSubmit = () => {
|
||||
if (!newCompetitorUrl) return;
|
||||
|
||||
setIsAdding(true);
|
||||
try {
|
||||
// Create a basic competitor object
|
||||
// In a real implementation, you might want to fetch metadata here or let the parent handle it
|
||||
@@ -114,8 +112,6 @@ const CompetitorsGrid: React.FC<CompetitorsGridProps> = ({
|
||||
setNewCompetitorUrl('');
|
||||
} catch (error) {
|
||||
console.error('Error adding competitor:', error);
|
||||
} finally {
|
||||
setIsAdding(false);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ import {
|
||||
Tab,
|
||||
Tabs,
|
||||
Paper,
|
||||
Divider,
|
||||
IconButton,
|
||||
// Divider,
|
||||
// IconButton,
|
||||
Tooltip,
|
||||
TextField,
|
||||
Collapse,
|
||||
@@ -35,7 +35,7 @@ import {
|
||||
AccessibilityNew as AccessibilityIcon,
|
||||
ExpandMore as ExpandMoreIcon,
|
||||
ExpandLess as ExpandLessIcon,
|
||||
Info as InfoIcon,
|
||||
// Info as InfoIcon,
|
||||
PlayArrow as PlayArrowIcon,
|
||||
Schedule as ScheduleIcon
|
||||
} from '@mui/icons-material';
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import React, { useState } from 'react';
|
||||
import React from 'react';
|
||||
import {
|
||||
Box,
|
||||
Typography,
|
||||
Tooltip,
|
||||
IconButton,
|
||||
Popover,
|
||||
Fade,
|
||||
Paper
|
||||
// Popover,
|
||||
// Fade,
|
||||
// Paper
|
||||
} from '@mui/material';
|
||||
import {
|
||||
Info as InfoIcon,
|
||||
HelpOutline as HelpIcon
|
||||
// HelpOutline as HelpIcon
|
||||
} from '@mui/icons-material';
|
||||
|
||||
interface SectionHeaderProps {
|
||||
@@ -28,9 +28,9 @@ const SectionHeader: React.FC<SectionHeaderProps> = ({
|
||||
variant = 'h5',
|
||||
sx = {}
|
||||
}) => {
|
||||
const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null);
|
||||
// const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null);
|
||||
|
||||
const handlePopoverOpen = (event: React.MouseEvent<HTMLElement>) => {
|
||||
/* const handlePopoverOpen = (event: React.MouseEvent<HTMLElement>) => {
|
||||
setAnchorEl(event.currentTarget);
|
||||
};
|
||||
|
||||
@@ -38,7 +38,7 @@ const SectionHeader: React.FC<SectionHeaderProps> = ({
|
||||
setAnchorEl(null);
|
||||
};
|
||||
|
||||
const open = Boolean(anchorEl);
|
||||
const open = Boolean(anchorEl); */
|
||||
|
||||
return (
|
||||
<Box
|
||||
|
||||
@@ -12,7 +12,6 @@ import {
|
||||
Chip,
|
||||
Card,
|
||||
CardContent,
|
||||
Divider,
|
||||
LinearProgress
|
||||
} from '@mui/material';
|
||||
import {
|
||||
@@ -72,7 +71,7 @@ const SitemapAnalysisResults: React.FC<SitemapAnalysisResultsProps> = ({
|
||||
}) => {
|
||||
const structureAnalysis: StructureAnalysis = analysisData.structure_analysis || {};
|
||||
const contentTrends: ContentTrends = analysisData.content_trends || {};
|
||||
const publishingPatterns: PublishingPatterns = analysisData.publishing_patterns || {};
|
||||
// const publishingPatterns: PublishingPatterns = analysisData.publishing_patterns || {};
|
||||
const onboardingInsights: OnboardingInsights = analysisData.onboarding_insights || {};
|
||||
|
||||
if (isLoading) {
|
||||
|
||||
@@ -3,8 +3,8 @@ import {
|
||||
Box,
|
||||
Typography,
|
||||
Grid,
|
||||
Card,
|
||||
CardContent,
|
||||
// Card,
|
||||
// CardContent,
|
||||
Chip,
|
||||
Tabs,
|
||||
Tab,
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
ListItem,
|
||||
ListItemText,
|
||||
ListItemIcon,
|
||||
Divider,
|
||||
// Divider,
|
||||
Alert,
|
||||
Paper,
|
||||
Tooltip,
|
||||
@@ -74,9 +74,9 @@ const SitemapAnalysisSection: React.FC<SitemapAnalysisSectionProps> = ({
|
||||
const {
|
||||
structure_analysis,
|
||||
content_trends,
|
||||
publishing_patterns,
|
||||
// publishing_patterns,
|
||||
ai_insights,
|
||||
seo_recommendations
|
||||
// seo_recommendations
|
||||
} = sitemapAnalysis;
|
||||
|
||||
return (
|
||||
|
||||
@@ -21,7 +21,7 @@ import {
|
||||
Info as InfoIcon,
|
||||
CheckCircle as CheckIcon,
|
||||
Lightbulb as LightbulbIcon,
|
||||
Star as StarIcon
|
||||
// Star as StarIcon
|
||||
} from '@mui/icons-material';
|
||||
import SectionHeader from './SectionHeader';
|
||||
|
||||
|
||||
@@ -18,10 +18,10 @@ import {
|
||||
} from '@mui/material';
|
||||
import {
|
||||
Analytics as AnalyticsIcon,
|
||||
AutoAwesome as AutoAwesomeIcon,
|
||||
// AutoAwesome as AutoAwesomeIcon,
|
||||
Psychology as PsychologyIcon,
|
||||
Info as InfoIcon,
|
||||
MenuBook as MenuBookIcon,
|
||||
// MenuBook as MenuBookIcon,
|
||||
Timeline as TimelineIcon,
|
||||
Star as StarIcon
|
||||
} from '@mui/icons-material';
|
||||
|
||||
Reference in New Issue
Block a user