mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
01439641ca
React IDE page: working editor GitOrigin-RevId: 3ba8cb787a6f7f8435686d8962adb7444d09acb5
11 lines
377 B
TypeScript
11 lines
377 B
TypeScript
import { findInTree } from '@/features/file-tree/util/find-in-tree'
|
|
import { Folder } from '../../../../../types/folder'
|
|
import { Doc } from '../../../../../types/doc'
|
|
|
|
export function findDocEntityById(fileTreeData: Folder, docId: string) {
|
|
const item = findInTree(fileTreeData, docId)
|
|
if (!item || item.type !== 'doc') {
|
|
return null
|
|
}
|
|
return item.entity as Doc
|
|
}
|