import React from "react"; import { Kanban as KanbanComponent, KanbanProps } from "../../components"; import { FieldSet } from "../../lib"; import { BodyBaseTemplateProps, CardBaseTemplate } from "../base"; export type KanbanTemplateProps = BodyBaseTemplateProps & { kanbanProps: KanbanProps; }; /** * Kanban Template * * Uses a `Kanban` to render a lists of data within `CardBaseTemplate`. * * @typeParam T - The shape of a single item. */ export const KanbanTemplate = ({ children, kanbanProps, ...props }: KanbanTemplateProps) => { const { objectList, objectLists, fieldset, fieldsets, groupBy, ...kbProps } = kanbanProps; return ( {children} {groupBy ? ( objectList={objectList as T[]} fieldset={fieldset as FieldSet} groupBy={groupBy} {...kbProps} > {children} ) : ( objectLists={objectLists as T[][]} fieldsets={fieldsets as FieldSet[]} {...kbProps} > {children} )} ); };