| 27 | > = new Map(); |
| 28 | |
| 29 | function readRecord<T>(record: Thenable<T>): T | Error { |
| 30 | if (typeof React.use === 'function') { |
| 31 | try { |
| 32 | // eslint-disable-next-line react-hooks-published/rules-of-hooks |
| 33 | return React.use(record); |
| 34 | } catch (x) { |
| 35 | if (record.status === 'rejected') { |
| 36 | return (record.reason: any); |
| 37 | } |
| 38 | throw x; |
| 39 | } |
| 40 | } |
| 41 | if (record.status === 'fulfilled') { |
| 42 | return record.value; |
| 43 | } else if (record.status === 'rejected') { |
| 44 | return (record.reason: any); |
| 45 | } else { |
| 46 | throw record; |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | export function importFile(file: File): TimelineData | Error { |
| 51 | const fileName = file.name; |