import React, { useState } from "react";
import selected from "./selected.svg";
const BoxNextToEachOther = ({ items }) => {
const [active, setActive] = useState(null);
return (
{items.map((item, index) => (
setActive(active === item ? null : item)}
>
{console.log(setActive)}
{item.title}
{active === item && (
)}
))}
);
};
export default BoxNextToEachOther;
BoxNextToEachOther.defaultProps = {
items: [
{
title: "زائر",
},
{
title: "خادم",
},
{
title: "ایرانی",
},
{
title: "غیر ایرانی",
},
],
};