import { useRecoilValue } from "recoil" ; import EditorTab from "../modules/editor_tab" ; import { editors } from "../utils/atoms" ; import { FileFormat } from "../utils/client" ; export default function useEditor ( ) { const loadedEditors = useRecoilValue ( editors ) ; return ( format ) => loadedEditors . find ( ( editor ) => editor . isCompatible ( format ) ) ; }