"use client"; import BABox from "./BABox"; import { BACheckbox, BALoader, BAPera } from "."; import { DeleteOutlined } from "@ant-design/icons"; import { useState } from "react"; import { theme } from "antd"; type propsType = { datasourse: any[]; cols: { key: string; label: string; displayField?: (data: any, i: number) => any; HeaderField?: any; }[]; loading?: boolean; onChange?: any; displayField?: any; closeModal?: any; onRowClick?: any; allowMultiple?: boolean; setDataSource?: any; className?: string; allowSearch?: boolean; allowDelete?: boolean; onDelete?: (index: number) => void; colSearchObj?: any, handleSearch?: (pgObj?: any, SearchObj?: any) => void; }; export default function BAGrid(props: propsType) { const { datasourse, cols, loading, displayField, onRowClick, } = props; const { token }: any = theme.useToken(); return ( {loading ? : {cols.map((col: any, index: number) => ( ))} {datasourse && datasourse.length > 0 ? ( datasourse.map((row: any, rowIndex: number) => ( (onRowClick ? onRowClick(rowIndex, row) : {})} > {cols.map((col: any, colIndex: number) => ( ))} )) ) : ( )}
{col.label}
{col.displayField ? col.displayField(row, rowIndex) : row[col.key]} {col.HeaderField ? col.HeaderField(rowIndex) : ""}
No Data Found
}
); }