Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Extr

Manav Rathia0335b82c6da
diff --git a/web/packages/new/photos/pages/duplicates.tsx b/web/packages/new/photos/pages/duplicates.tsx
index d442104f86..20445faa90 100644
--- a/web/packages/new/photos/pages/duplicates.tsx
+++ b/web/packages/new/photos/pages/duplicates.tsx
@@ -289,12 +289,7 @@ const NoDuplicatesFound: React.FC = () => (
</CenteredFill>
);
-type DuplicatesProps = DeduplicateButtonProps & {
- /**
- * Groups of duplicates. Guaranteed to be non-empty.
- */
- duplicateGroups: DuplicateGroup[];
-};
+type DuplicatesProps = DuplicatesListProps & DeduplicateButtonProps;
const Duplicates: React.FC<DuplicatesProps> = ({
duplicateGroups,
@@ -303,22 +298,7 @@ const Duplicates: React.FC<DuplicatesProps> = ({
return (
<Stack sx={{ flex: 1 }}>
<Box sx={{ flex: 1, overflow: "hidden" }}>
- <Autosizer>
- {({ height, width }) => (
- <Box
- sx={{
- width,
- height,
- border: "1px solid red",
- fontSize: "4rem",
- }}
- >
- {duplicateGroups.map((dup, i) => (
- <div key={i}>{dup.items.length}</div>
- ))}
- </Box>
- )}
- </Autosizer>
+ <DuplicatesList {...{ duplicateGroups }} />
</Box>
<Stack sx={{ margin: 1 }}>
<DeduplicateButton {...deduplicateButtonProps} />
@@ -327,6 +307,27 @@ const Duplicates: React.FC<DuplicatesProps> = ({
);
};
+interface DuplicatesListProps {
+ /**
+ * Groups of duplicates. Guaranteed to be non-empty.
+ */
+ duplicateGroups: DuplicateGroup[];
+}
+
+const DuplicatesList: React.FC<DuplicatesListProps> = ({ duplicateGroups }) => {
+ return (
+ <Autosizer>
+ {({ height, width }) => (
+ <Box sx={{ width, height }}>
+ {duplicateGroups.map((dup, i) => (
+ <div key={i}>{dup.items.length}</div>
+ ))}
+ </Box>
+ )}
+ </Autosizer>
+ );
+};
+
interface DeduplicateButtonProps {
/**
* See {@link prunableCount} in {@link DedupState}.