import * as React from 'react';
import { TableListItemProps } from '../TableListItem';

export type Action = {
  label: string;
  onClick(e: Event, item?: NestableListItem): void;
  prefixIcon?: React.ReactNode;
};

export type NestableListItem = {
  id: string | number;
  actionsDataHook?: string;
  draggable?: boolean;
  isCollapsed?: boolean;
  addItemLabel?: string;
  actions?: Action[];
  children?: NestableListItem[];
} & TableListItemProps;

export interface NestableListProps {
  dataHook?: string;
  withBottomBorder?: boolean;
  className?: string;
  readOnly?: boolean;
  actions?: Action[];
  items: NestableListItem[];
  preventChangeDepth?: boolean;
  maxDepth?: number;
  addItemLabel?: string;
  onChange?(data: { items: NestableListItem[]; item: NestableListItem }): void;
  onAddItem?(item: NestableListItem): void;
  zIndex?: number;
}

export default class NestableList extends React.PureComponent<NestableListProps> {}
