EnxDev commented on code in PR #37396:
URL: https://github.com/apache/superset/pull/37396#discussion_r2731318336
##########
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:
In this case, we can keep it within this component since it’s not reused
elsewhere.
Generally, I prefer breaking components down to improve testability and
avoid monolithic components.
--
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]