adjust header styles

This commit is contained in:
jeffvli
2026-02-09 10:44:07 -08:00
parent ba4b07614c
commit e34282338d
2 changed files with 20 additions and 7 deletions
@@ -28,7 +28,7 @@
gap: var(--theme-spacing-md);
padding: 0 var(--theme-spacing-md);
font-size: var(--theme-font-size-sm);
color: var(--theme-colors-foreground-muted);
user-select: none;
background-color: var(--theme-colors-background);
border-bottom: 1px solid var(--theme-colors-border);
}
@@ -610,6 +610,18 @@ interface DetailListHeaderProps {
trackTableSize: 'compact' | 'default' | 'large';
}
const colTypeToAlignMap = {
center: 'center',
end: 'right',
start: 'left',
};
const colTypeToJustifyContentMap = {
center: 'center',
end: 'flex-end',
start: 'flex-start',
};
const DetailListHeader = memo(
({
columnWidthPercents,
@@ -633,16 +645,17 @@ const DetailListHeader = memo(
const percent = columnWidthPercents[colIndex] ?? 0;
const { fixedWidth, isFixedColumn } = getTrackColumnFixed(col.id);
const isLastColumn = colIndex === trackColumns.length - 1;
const style: React.CSSProperties = {
flex: isFixedColumn ? `0 0 ${fixedWidth}px` : `${percent} 1 0`,
justifyContent: colTypeToJustifyContentMap[col.align],
minWidth: isFixedColumn ? fixedWidth : 0,
textAlign:
col.align === 'start'
? 'left'
: col.align === 'end'
? 'right'
: 'center',
textAlign: colTypeToAlignMap[col.align] as
| 'center'
| 'left'
| 'right',
};
return (
<div
className={clsx(styles.trackHeaderCell, {