import * as React from 'react' ; import { useProtocolDetails } from '../../../RunDetails/hooks' ; import { getLabwarePositionCheckSteps } from '../getLabwarePositionCheckSteps' ; import type { LabwarePositionCheckStep } from '../types' ; export function useSteps ( ) { const [ LPCSteps , setLPCSteps ] = React . useState < LabwarePositionCheckStep [ ] > ( [ ] ) ; const { protocolData } = useProtocolDetails ( ) ; if ( protocolData == null ) return [ ] ; if ( LPCSteps . length === 0 ) { setLPCSteps ( getLabwarePositionCheckSteps ( protocolData ) ) ; } return LPCSteps ; }