Copilot commented on code in PR #10234:
URL: https://github.com/apache/gravitino/pull/10234#discussion_r2887963475
##########
web-v2/web/src/components/PropertiesContent.js:
##########
@@ -29,33 +28,38 @@ const PropertiesContent = ({ properties, dataReferPrefix,
contentDataRefer }) =>
const contentProps = contentDataRefer ? { 'data-refer': contentDataRefer } :
{}
return (
- <Space.Compact className='max-h-80 overflow-auto' {...contentProps}>
- <Space.Compact direction='vertical' className='divide-y border-gray-100'>
- <span className='min-w-24 bg-gray-100 p-1'>Key</span>
- {entries.map(([key]) => (
- <span className='p-1 block min-w-24 max-w-60 truncate' title={key}
key={`prop-key-${key}`} {...keyProps(key)}>
- {key}
- </span>
- ))}
- </Space.Compact>
- <Space.Compact direction='vertical' className='divide-y border-gray-100'>
- <span className='min-w-24 bg-gray-100 p-1'>Value</span>
+ <div className='max-h-80 overflow-auto' {...contentProps}>
+ <div className='min-w-[28rem]'>
+ <div className='sticky top-0 z-10 grid grid-cols-2 bg-gray-100'>
+ <span className='p-1 font-medium'>Key</span>
+ <span className='p-1 font-medium'>Value</span>
+ </div>
{entries.map(([key, value]) => {
const safeValue = sanitizeText(value) || '-'
return (
- <span
- className='p-1 block min-w-24 max-w-60 truncate'
- title={safeValue}
- key={`prop-val-${key}`}
- {...valueProps(key)}
- >
- {safeValue}
- </span>
+ <div key={`prop-row-${key}`} className='grid grid-cols-2 border-t
border-gray-100'>
+ <span
+ className='block min-w-24 max-w-60 truncate p-1 leading-6'
+ title={key}
+ key={`prop-key-${key}`}
+ {...keyProps(key)}
+ >
+ {key}
+ </span>
+ <span
+ className='block min-w-24 max-w-60 truncate p-1 leading-6'
+ title={safeValue}
+ key={`prop-val-${key}`}
Review Comment:
The `key` props on the inner `<span>` elements (lines 45 and 53) are
unnecessary since their parent `<div>` on line 41 already has a unique `key`.
React only needs `key` on the elements returned from a `map()` call (the
top-level siblings), not on their children. These can be safely removed to
reduce noise.
--
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]