refactor: remove redundant propTypes in ColumnElement (#18144)

* Remove redundant propTypes

* Refactoring

* Refactoring
This commit is contained in:
EugeneTorap 2022-02-07 21:25:07 +03:00 committed by GitHub
parent cebff83d0c
commit 85c8d0183b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 9 deletions

View File

@ -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;