refactor: remove redundant propTypes in ColumnElement (#18144)
* Remove redundant propTypes * Refactoring * Refactoring
This commit is contained in:
parent
cebff83d0c
commit
85c8d0183b
|
|
@ -17,16 +17,10 @@
|
|||
* under the License.
|
||||
*/
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { ClassNames } from '@emotion/react';
|
||||
import { styled, useTheme } from '@superset-ui/core';
|
||||
|
||||
import { Tooltip } from 'src/components/Tooltip';
|
||||
|
||||
const propTypes = {
|
||||
column: PropTypes.object.isRequired,
|
||||
};
|
||||
|
||||
const StyledTooltip = (props: any) => {
|
||||
const theme = useTheme();
|
||||
return (
|
||||
|
|
@ -64,6 +58,7 @@ const iconMap = {
|
|||
fk: 'fa-link',
|
||||
index: 'fa-bookmark',
|
||||
};
|
||||
|
||||
const tooltipTitleMap = {
|
||||
pk: 'Primary key',
|
||||
fk: 'Foreign key',
|
||||
|
|
@ -80,7 +75,7 @@ interface ColumnElementProps {
|
|||
};
|
||||
}
|
||||
|
||||
export default function ColumnElement({ column }: ColumnElementProps) {
|
||||
const ColumnElement = ({ column }: ColumnElementProps) => {
|
||||
let columnName: React.ReactNode = column.name;
|
||||
let icons;
|
||||
if (column.keys && column.keys.length > 0) {
|
||||
|
|
@ -115,5 +110,6 @@ export default function ColumnElement({ column }: ColumnElementProps) {
|
|||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
ColumnElement.propTypes = propTypes;
|
||||
};
|
||||
|
||||
export default ColumnElement;
|
||||
|
|
|
|||
Loading…
Reference in New Issue