diff --git a/src/components/sections/Skills.tsx b/src/components/sections/Skills.tsx index 2f9f78a..e1e6237 100644 --- a/src/components/sections/Skills.tsx +++ b/src/components/sections/Skills.tsx @@ -10,6 +10,46 @@ interface Skill { level: number; } +interface SkeletonProps { + className?: string; +} + +const Skeleton: React.FC = ({ className }) => ( +
+); + +const SkillsSkeleton = () => ( +
+
+ +
+ {/* Skills Progress Bars Skeleton */} +
+ {[1, 2, 3, 4, 5, 6, 7, 8].map((i) => ( +
+
+ + +
+ +
+ ))} +
+ + {/* Skills Icons Grid Skeleton */} +
+ {[1, 2, 3, 4, 5, 6].map((i) => ( +
+ + +
+ ))} +
+
+
+
+); + const iconMap: Record = { 'AI & LLMs': , 'Automation': , @@ -27,19 +67,24 @@ const Skills = () => { const [skills, setSkills] = useState([]); useEffect(() => { - try { - const translatedSkills = t.raw('skills') as Skill[]; - if (Array.isArray(translatedSkills)) { - setSkills(translatedSkills); + // Temporary delay to see skeleton loading state + const timer = setTimeout(() => { + try { + const translatedSkills = t.raw('skills') as Skill[]; + if (Array.isArray(translatedSkills)) { + setSkills(translatedSkills); + } + } catch (error) { + console.error('Error loading skills:', error); + setSkills([]); } - } catch (error) { - console.error('Error loading skills:', error); - setSkills([]); - } + }, 2000); + + return () => clearTimeout(timer); }, [t]); if (skills.length === 0) { - return
Loading skills...
; + return ; } return (