Skip to content

Commit

Permalink
chore(ui): simplify CellValue (#3024)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamie-rasmussen authored Nov 20, 2024
1 parent 2771494 commit 3eea8df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {SmallRef} from './SmallRef';

type CellValueProps = {
value: any;
isExpanded?: boolean;
};

const Collapsed = styled.div<{hasScrolling: boolean}>`
Expand All @@ -32,15 +31,15 @@ const Collapsed = styled.div<{hasScrolling: boolean}>`
`;
Collapsed.displayName = 'S.Collapsed';

export const CellValue = ({value, isExpanded = false}: CellValueProps) => {
export const CellValue = ({value}: CellValueProps) => {
if (value === undefined) {
return null;
}
if (value === null) {
return <ValueViewPrimitive>null</ValueViewPrimitive>;
}
if (isWeaveRef(value)) {
return <SmallRef objRef={parseRef(value)} iconOnly={isExpanded} />;
return <SmallRef objRef={parseRef(value)} />;
}
if (typeof value === 'boolean') {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ export const CallScoresViewer: React.FC<{
lineHeight: '20px',
alignItems: 'center',
}}>
<CellValue value={value} isExpanded={false} />
<CellValue value={value} />
</Box>
);
},
Expand Down

0 comments on commit 3eea8df

Please sign in to comment.