()
| 7 | import { autoInstantiateAtom } from "@/core/config/config"; |
| 8 | |
| 9 | export function useAddCodeToNewCell(): (code: string) => void { |
| 10 | const autoInstantiate = useAtomValue(autoInstantiateAtom); |
| 11 | const lastFocusedCellId = useLastFocusedCellId(); |
| 12 | const { createNewCell } = useCellActions(); |
| 13 | |
| 14 | return (code: string) => { |
| 15 | if (code.includes("alt")) { |
| 16 | maybeAddAltairImport({ |
| 17 | autoInstantiate, |
| 18 | createNewCell, |
| 19 | fromCellId: lastFocusedCellId, |
| 20 | }); |
| 21 | } |
| 22 | |
| 23 | createNewCell({ |
| 24 | code: code, |
| 25 | before: false, |
| 26 | cellId: lastFocusedCellId ?? "__end__", |
| 27 | }); |
| 28 | }; |
| 29 | } |
no test coverage detected
searching dependent graphs…