mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-10-16 14:50:15 +08:00
26 lines
819 B
TypeScript
26 lines
819 B
TypeScript
/*
|
|
* CloudBeaver - Cloud Database Manager
|
|
* Copyright (C) 2020-2022 DBeaver Corp and others
|
|
*
|
|
* Licensed under the Apache License, Version 2.0.
|
|
* you may not use this file except in compliance with the License.
|
|
*/
|
|
|
|
import { observer } from 'mobx-react-lite';
|
|
import { useContext } from 'react';
|
|
import type { HeaderRendererProps } from 'react-data-grid';
|
|
|
|
import type { DBObject } from '@cloudbeaver/core-app';
|
|
|
|
import { TableContext } from './TableContext';
|
|
|
|
export const HeaderRenderer = observer<HeaderRendererProps<DBObject>>(function HeaderRenderer(props) {
|
|
const tableContext = useContext(TableContext);
|
|
const dataColumn = tableContext.tableData?.columns.find(column => column.key === props.column.key);
|
|
|
|
return (
|
|
<div title={dataColumn?.description}>
|
|
{props.column.name}
|
|
</div>
|
|
);
|
|
}); |