/
vshmidt
/
label-studio
Обзор
Документация
Войти
/
vshmidt
/
label-studio
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
web/libs/datamanager/src/components/CellViews/ImageCell.jsx
49 строк
1 KB
Yousif Yassi
fix: FIT-1486: Very Slow Data Loading with S3 Integration (#9524)
05 мар 2026, 00:45
Не верифицирован
05 мар 2026, 00:45
7e915cb
Код
Авторство
О чём код?
import { getRoot } from "mobx-state-tree"; import { AnnotationPreview } from "../Common/AnnotationPreview/AnnotationPreview"; const imgDefaultProps = { crossOrigin: "anonymous" }; export const ImageCell = (column) => { const { original, value, column: { alias }, } = column; const root = getRoot(original); const renderImagePreview = original.total_annotations === 0 || !root.showPreviews; const imgSrc = Array.isArray(value) ? value[0] : value; if (!imgSrc) return null; return renderImagePreview ? ( <img {...imgDefaultProps} key={imgSrc} src={imgSrc} alt="Data" loading="lazy" style={{ maxHeight: "100%", maxWidth: "100px", objectFit: "contain", borderRadius: 3, }} /> ) : ( <AnnotationPreview task={original} annotation={original.annotations[0]} config={getRoot(original).SDK} name={alias} variant="120x120" fallbackImage={value} style={{ maxHeight: "100%", maxWidth: "100px", objectFit: "contain", borderRadius: 3, }} /> ); };