/* eslint-disable @typescript-eslint/no-explicit-any */ import { TextBox, InputClearValue, InputSeparator, } from "@progress/kendo-react-inputs"; import DragDropContainer from "./DragDropContext"; import { DragDropContext, Droppable, Draggable } from "react-beautiful-dnd"; import React from "react"; import { ChooserColumn } from "../../../data/setting"; import FactoryRenderer from "../../../../../Renderer"; export type ColumnChooserViewProps = { popupChooserRef: any; allColumns: ChooserColumn[]; selectedColumns: ChooserColumn[]; searchInput: string; onFieldAddOrRemove: (id: number) => void; excludeIncludeToCard: (id: number) => void; toggleFreeze: (id: number) => void; onChooserApply: () => void; onChooserRestore: () => void; onChooserClose: () => void; onFieldDragEnd: (result: any) => void; setSearchInput: (searchKey: string) => void; }; const ColumnChooserView: React.FC = (props) => { return (

Column Chooser

props.setSearchInput(e.target.value as string)} suffix={() => props.searchInput ? ( <> props.setSearchInput("")}> ) : ( <> ) } />
{props.allColumns.length === 0 && (

No fields found

)} {props.allColumns.map((column) => ( { if (column.primary !== true) { props.onFieldAddOrRemove(column.id); } }} /> ))}

{props.selectedColumns.length > 0 ? `${props.selectedColumns.length} Column(s) Selected` : `No fields selected`}

{(provided: any) => (
{props.selectedColumns.map((column, index) => column.primary ? ( ) : ( {(provided: any) => (
)}
), )} {provided.placeholder}
)}
); }; export default ColumnChooserView;