import { HexString, generateCodeHash } from '@gear-js/api'; import { useApi, useAlert } from '@gear-js/react-hooks'; import { generatePath } from 'react-router-dom'; import { FileTypes, routes } from '@/shared/config'; import { CustomLink } from '@/shared/ui/customLink'; import { WasmFileType } from '../types'; import { WASM_FILE_TYPE } from '../consts'; type OnChange = (value: File | undefined, buffer: Buffer | undefined) => void; // upload-code feature? function useWasmFileHandler(type: WasmFileType, onChange: OnChange = () => {}) { const { api, isApiReady } = useApi(); const alert = useAlert(); const renderCodeExistsAlert = (codeId: HexString) => ( <>
Code already exists
ID: