semohr commented on code in PR #37396:
URL: https://github.com/apache/superset/pull/37396#discussion_r2731334951
##########
superset-frontend/src/explore/components/DataTableControl/index.tsx:
##########
@@ -222,6 +222,31 @@ const DataTableTemporalHeaderCell = ({
);
};
+const DataTableHeaderCell = ({
+ columnName,
+ columnLabel,
+}: {
+ columnName: string;
+ columnLabel?: string;
+}) => {
+ // Use label if provided, otherwise use column name
+ // as header
+ const displayText = columnLabel || columnName;
+ if (columnLabel && columnLabel !== columnName) {
+ return (
+ <Popover
+ content={`${t('Column name')}: ${columnName}`}
+ placement="bottomLeft"
+ arrow={{ pointAtCenter: true }}
+ >
+ <span>{displayText}</span>
+ </Popover>
+ );
+ }
+
+ return <span>{displayText}</span>;
+};
+
Review Comment:
Makes sense! We might be able to unify with `DataTableTemporalHeaderCell`
:thinking:
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]