import React, { useState, useEffect } from 'react'; import style from './Outstaffing.module.css'; import front from '../../images/front_end.png'; import back from '../../images/back_end.png'; import design from '../../images/design.png'; import OutstaffingBlock from './OutstaffingBlock'; import TagSelect from '../Select/TagSelect'; const Outstaffing = () => { const [data, setData] = useState([]); const [selectedItems, setSelectedItems] = useState([]); useEffect(() => { const tempData = ['Ruby on Rails', 'Nginx', 'Docker', 'PostgreSQL', 'Vue.js', 'Typescript', 'ReactJS']; setData(tempData); }, []); const handleBlockClick = (index) => { if (selectedItems.find((item) => item.value === data[index])) { return; // setSelectedItems(selectedItems.filter((item) => item.value !== data[index])); } else { setSelectedItems([...selectedItems, { value: data[index], label: data[index] }]); } }; const handleSubmit = () => { const filterItems = JSON.stringify(selectedItems.map((item) => item.value)); alert(`Back-end: ${filterItems}`); setSelectedItems([]); }; return ( <> Аутстаффинг it-персонала handleBlockClick(index)} /> handleBlockClick(index)} /> handleBlockClick(index)} /> > ); }; export default Outstaffing;