import type { ActionLogLookup } from '../fragment-types'

const isOverlay = (actionLog: ActionLogLookup) => {
  switch (actionLog.details.__typename) {
    case 'InjectDetailsType': // fallthrough
    case 'CustomInjectDetailsType': // fallthrough
    case 'EmailType':
      return actionLog.details.overlay !== null
    case 'TeamQuestionnaireStateType':
      return actionLog.details.questionnaire.overlay !== null
    case 'ToolDetailsType':
      return false
  }
}

export default isOverlay
