import { Source } from '../services/SourceService'; const fileIds = (source: Source): string[] => { return [source?.imageFileId ?? '']; }; const durationHours = (source: Source): string => { return parseFloat(String((source?.durationSeconds ?? 0) / 3600)).toFixed(1); }; const documentCount = (sources: Source[]): number => { return sources.map((source) => source.documentCount).reduce((a, b) => a + b, 0); }; const SourceUtil = { fileIds, durationHours, documentCount, }; export default SourceUtil;