fixing linting and tests errors
This commit is contained in:
@@ -4,13 +4,9 @@ import React, { useState, useEffect } from 'react';
|
||||
import { motion, AnimatePresence } from 'framer-motion';
|
||||
import {
|
||||
Mail,
|
||||
Users,
|
||||
BarChart3,
|
||||
Database,
|
||||
Zap,
|
||||
Globe,
|
||||
Shield,
|
||||
Bell,
|
||||
Settings,
|
||||
FileText,
|
||||
TrendingUp,
|
||||
@@ -18,23 +14,9 @@ import {
|
||||
Plus,
|
||||
Edit,
|
||||
Trash2,
|
||||
Eye,
|
||||
Save,
|
||||
Upload,
|
||||
Bold,
|
||||
Italic,
|
||||
List,
|
||||
Link as LinkIcon,
|
||||
Image as ImageIcon,
|
||||
Code,
|
||||
Quote,
|
||||
ChevronDown,
|
||||
ChevronRight,
|
||||
Palette,
|
||||
Smile
|
||||
Eye
|
||||
} from 'lucide-react';
|
||||
import Link from 'next/link';
|
||||
import ReactMarkdown from 'react-markdown';
|
||||
import { EmailManager } from './EmailManager';
|
||||
import { AnalyticsDashboard } from './AnalyticsDashboard';
|
||||
import ImportExport from './ImportExport';
|
||||
@@ -81,43 +63,7 @@ interface Project {
|
||||
const ModernAdminDashboard: React.FC = () => {
|
||||
const [activeTab, setActiveTab] = useState<'overview' | 'projects' | 'emails' | 'analytics' | 'settings'>('overview');
|
||||
const [projects, setProjects] = useState<Project[]>([]);
|
||||
const [selectedProject, setSelectedProject] = useState<Project | null>(null);
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
const [showProjectEditor, setShowProjectEditor] = useState(false);
|
||||
const [isPreview, setIsPreview] = useState(false);
|
||||
const [markdownContent, setMarkdownContent] = useState('');
|
||||
const [formData, setFormData] = useState({
|
||||
title: '',
|
||||
description: '',
|
||||
content: '',
|
||||
tags: '',
|
||||
category: '',
|
||||
featured: false,
|
||||
github: '',
|
||||
live: '',
|
||||
published: true,
|
||||
imageUrl: '',
|
||||
difficulty: 'Intermediate' as 'Beginner' | 'Intermediate' | 'Advanced' | 'Expert',
|
||||
timeToComplete: '',
|
||||
technologies: '',
|
||||
challenges: '',
|
||||
lessonsLearned: '',
|
||||
futureImprovements: '',
|
||||
demoVideo: '',
|
||||
screenshots: '',
|
||||
colorScheme: 'Dark',
|
||||
accessibility: true,
|
||||
performance: {
|
||||
lighthouse: 90,
|
||||
bundleSize: '50KB',
|
||||
loadTime: '1.5s'
|
||||
},
|
||||
analytics: {
|
||||
views: 0,
|
||||
likes: 0,
|
||||
shares: 0
|
||||
}
|
||||
});
|
||||
|
||||
// Mock stats for overview
|
||||
const stats = {
|
||||
@@ -175,14 +121,6 @@ const ModernAdminDashboard: React.FC = () => {
|
||||
setShowProjectEditor(true);
|
||||
};
|
||||
|
||||
const handleSave = async () => {
|
||||
// Save logic here
|
||||
console.log('Saving project...');
|
||||
await loadProjects();
|
||||
setShowProjectEditor(false);
|
||||
setSelectedProject(null);
|
||||
};
|
||||
|
||||
const handleDelete = async (projectId: number) => {
|
||||
if (confirm('Are you sure you want to delete this project?')) {
|
||||
try {
|
||||
@@ -240,12 +178,6 @@ const ModernAdminDashboard: React.FC = () => {
|
||||
{ id: 'settings', label: 'Settings', icon: Settings, color: 'gray' }
|
||||
];
|
||||
|
||||
const categories = [
|
||||
"Web Development", "Full-Stack", "Web Application", "Mobile App",
|
||||
"Desktop App", "API Development", "Database Design", "DevOps",
|
||||
"UI/UX Design", "Game Development", "Machine Learning", "Data Science",
|
||||
"Blockchain", "IoT", "Cybersecurity"
|
||||
];
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-gradient-to-br from-slate-900 via-purple-900 to-slate-900">
|
||||
@@ -290,7 +222,7 @@ const ModernAdminDashboard: React.FC = () => {
|
||||
return (
|
||||
<button
|
||||
key={tab.id}
|
||||
onClick={() => setActiveTab(tab.id as any)}
|
||||
onClick={() => setActiveTab(tab.id as 'overview' | 'projects' | 'emails' | 'analytics' | 'settings')}
|
||||
className={`w-full flex items-center space-x-3 px-4 py-3 rounded-xl transition-all duration-200 ${
|
||||
activeTab === tab.id
|
||||
? `bg-${tab.color}-500/20 text-${tab.color}-400 border border-${tab.color}-500/30`
|
||||
|
||||
Reference in New Issue
Block a user