mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-10-19 23:41:08 +08:00

* feat: add the ability to drag columns * feat: add the ability to drag columns in the logs explorer * feat: update drag logic * fix: resolve comments * feat: resolve comment regarding error handling --------- Co-authored-by: Vishal Sharma <makeavish786@gmail.com> Co-authored-by: Palash Gupta <palashgdev@gmail.com>
25 lines
736 B
TypeScript
25 lines
736 B
TypeScript
import { dragColumnParams } from 'hooks/useDragColumns/configs';
|
|
import ReactDragListView from 'react-drag-listview';
|
|
import { TableComponents } from 'react-virtuoso';
|
|
|
|
import { TableStyled } from './styles';
|
|
|
|
interface LogsCustomTableProps {
|
|
handleDragEnd: (fromIndex: number, toIndex: number) => void;
|
|
}
|
|
|
|
export const LogsCustomTable = ({
|
|
handleDragEnd,
|
|
}: LogsCustomTableProps): TableComponents['Table'] =>
|
|
function CustomTable({ style, children }): JSX.Element {
|
|
return (
|
|
<ReactDragListView.DragColumn
|
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
{...dragColumnParams}
|
|
onDragEnd={handleDragEnd}
|
|
>
|
|
<TableStyled style={style}>{children}</TableStyled>
|
|
</ReactDragListView.DragColumn>
|
|
);
|
|
};
|