import { useContext } from 'react'; import { LoadingContext } from '../../contexts/LoadingContext'; import config from '../../ezprofile.config'; import { skeleton } from '../../helpers/utils'; const Skill = () => { const { loading } = useContext(LoadingContext); const renderSkeleton = () => { let array = []; for (let index = 0; index < 12; index++) { array.push(
{skeleton({ width: 'w-16', height: 'h-4', className: 'm-1' })}
); } return array; }; return ( <> {typeof config.skills !== 'undefined' && config.skills.length !== 0 && (
{loading ? ( skeleton({ width: 'w-32', height: 'h-8' }) ) : ( Tech Stack )}
{loading ? renderSkeleton() : config.skills.map((skill, index) => (
{skill}
))}
)} ); }; export default Skill;