Skip to content

Commit

Permalink
fix(@leav/ui): avoid having a "undefined" preview
Browse files Browse the repository at this point in the history
  • Loading branch information
P0ppoff authored and TdyP committed Feb 27, 2024
1 parent a578ecf commit 30a35d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const Wrapper = styled(Space)`
`;

function RecordSummary({record}: IRecordSummaryProps): JSX.Element {
const preview = String(record?.preview?.medium);
const preview = record?.preview?.medium ? String(record?.preview?.medium) : null;
const previewFile = record?.preview?.file;
const {token} = theme.useToken();

Expand Down
2 changes: 1 addition & 1 deletion libs/utils/src/types/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ export interface IPreviewScalar {
pdf?: string;
file: FileRecord;
original: string;
[key: string]: string | FileRecord;
[key: string]: string | FileRecord; // FIXME should be only a string
}

0 comments on commit 30a35d2

Please sign in to comment.