import { Button, Card, Col, Input, Table, Typography } from "antd"; import React, { useState } from "react"; import { useTranslation } from "react-i18next"; export default function ProfileShopsComponent({ loading, data, updateActiveShop, }) { const { t } = useTranslation(); const [search, setSearch] = useState(""); const columns = [ { title: t("associations.fields.shopname"), dataIndex: "shopname", key: "shopname", width: "25%", render: (text, record) => {record.bodyshop.shopname}, }, { title: t("associations.fields.active"), dataIndex: "active", key: "active", width: "25%", render: (text, record) => {record.active ? "Yes" : "No"}, }, { title: t("associations.labels.actions"), dataIndex: "actions", key: "actions", width: "25%", render: (text, record) => ( {record.active ? null : ( )} ), }, ]; const filteredData = search === "" ? data : data.filter((d) => d.bodyshop.shopname.toLowerCase().includes(search.toLowerCase()) ); return ( {t("profile.labels.activeshop")} } extra={ setSearch(e.target.value)} allowClear placeholder={t("general.labels.search")} /> } > ); }