web / lib/hooks/use-import-progress-query
lib/hooks/use-import-progress-query
React Query hook for polling import file progress.
Replaces hand-rolled setInterval polling in step-processing.tsx. Automatically stops polling when the import reaches a terminal state.
Interfaces
ProgressApiResponse
Properties
type
type:
string
id
id:
number
status
status:
"completed"|"failed"|"processing"|"pending"|"parsing"
originalName
originalName:
string
catalogId
catalogId:
number|null
datasetsCount
datasetsCount:
number
datasetsProcessed
datasetsProcessed:
number
overallProgress
overallProgress:
number
estimatedCompletionTime
estimatedCompletionTime:
string|null
jobs
jobs:
object[]
id
id:
string|number
datasetId
datasetId:
string|number
datasetName?
optionaldatasetName:string
currentStage
currentStage:
string
overallProgress
overallProgress:
number
stages?
optionalstages:object[]
results?
optionalresults:object
results.totalEvents?
optionaltotalEvents:number
errorLog?
optionalerrorLog:string|null
completedAt?
optionalcompletedAt:string|null
Variables
importProgressQueryKeys
constimportProgressQueryKeys:object
Type Declaration
all
all: readonly [
"import-progress"]
byFile()
byFile: (
importFileId) => readonly ["import-progress",string]
Parameters
importFileId
string | number
Returns
readonly ["import-progress", string]
Functions
useImportProgressQuery()
useImportProgressQuery(
importFileId):UseQueryResult<ProgressApiResponse,Error>
Parameters
importFileId
string | number | null
Returns
UseQueryResult<ProgressApiResponse, Error>