forked from pu428f3pz/InternshipProject
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
727 B
24 lines
727 B
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
import * as React from 'react';
|
|
import { renderColumnTitle } from '../util';
|
|
|
|
function fillTitle(columns, columnTitleProps) {
|
|
return columns.map(function (column) {
|
|
var cloneColumn = _extends({}, column);
|
|
|
|
cloneColumn.title = renderColumnTitle(column.title, columnTitleProps);
|
|
|
|
if ('children' in cloneColumn) {
|
|
cloneColumn.children = fillTitle(cloneColumn.children, columnTitleProps);
|
|
}
|
|
|
|
return cloneColumn;
|
|
});
|
|
}
|
|
|
|
export default function useTitleColumns(columnTitleProps) {
|
|
var filledColumns = React.useCallback(function (columns) {
|
|
return fillTitle(columns, columnTitleProps);
|
|
}, [columnTitleProps]);
|
|
return [filledColumns];
|
|
} |