From 988b5e65b03444fa165fc505ae311c7c57d02627 Mon Sep 17 00:00:00 2001 From: M1kola Date: Fri, 26 Jul 2024 20:07:43 +0300 Subject: [PATCH] employees table --- .../PartnerСategories/PartnerСategories.jsx | 44 +++++++++++++------ 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/src/pages/PartnerСategories/PartnerСategories.jsx b/src/pages/PartnerСategories/PartnerСategories.jsx index 4c16c21d..53711f64 100644 --- a/src/pages/PartnerСategories/PartnerСategories.jsx +++ b/src/pages/PartnerСategories/PartnerСategories.jsx @@ -46,7 +46,7 @@ export const PartnerCategories = () => { const theme = useTheme(getTheme()); const [nodes, setNodes] = useState([]); const [initialNodes, setInitialNodes] = useState([]); - const [activeTab, setActiveTab] = useState('Все') + const [activeTab, setActiveTab] = useState("Все"); const [search, setSearch] = useState(""); @@ -309,20 +309,38 @@ export const PartnerCategories = () => { />
-
{ - setActiveTab('Все') - setNodes(initialNodes) - }} className={activeTab === 'Все' ? 'table__tab table__tab--active' : 'table__tab'}>Все
+
{ + setActiveTab("Все"); + setNodes(initialNodes); + }} + className={ + activeTab === "Все" + ? "table__tab table__tab--active" + : "table__tab" + } + > + Все +
{tabs.map((tab) => { return ( -
{ - setActiveTab(tab.name) - setNodes( - initialNodes.filter((item) => - item.resume.userCard.position_id === tab.value - ) - ); - }} className={activeTab === tab.name ? 'table__tab table__tab--active' : 'table__tab'} key={tab.value}> +
{ + setActiveTab(tab.name); + setNodes( + initialNodes.filter( + (item) => + item.resume.userCard.position_id === tab.value + ) + ); + }} + className={ + activeTab === tab.name + ? "table__tab table__tab--active" + : "table__tab" + } + key={tab.value} + > {tab.name}
);