mirror of https://github.com/portainer/portainer
25 lines
525 B
TypeScript
25 lines
525 B
TypeScript
import { useMemo } from 'react';
|
|
import _ from 'lodash';
|
|
|
|
import { actions } from './actions';
|
|
import { node } from './node';
|
|
import { slot } from './slot';
|
|
import { status } from './status';
|
|
import { task } from './task';
|
|
import { updated } from './updated';
|
|
|
|
export function useColumns(isSlotColumnsVisible = true) {
|
|
return useMemo(
|
|
() =>
|
|
_.compact([
|
|
status,
|
|
task,
|
|
actions,
|
|
isSlotColumnsVisible && slot,
|
|
node,
|
|
updated,
|
|
]),
|
|
[isSlotColumnsVisible]
|
|
);
|
|
}
|