import { faAsterisk, faBomb, faCode, faCodeBranch, faCookieBite, faExchangeAlt, faFile, faHourglassHalf, faLayerGroup, faLightbulb, faPaintRoller, faQuestionCircle, faRandom, faSlidersH, faTerminal, faUser, faWindowMaximize } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import Command from "components/context/sections/Command"; import Custom from "components/context/sections/Custom"; import LiveWireIcon from 'components/ui/icons/LivewireIcon'; import startCase from 'lodash/startCase'; import React, { useContext } from 'react'; import urlSlug from 'url-slug'; import ErrorOccurrenceContext from '../../contexts/ErrorOccurrenceContext'; import InViewContextProvider from '../../contexts/InViewContextProvider'; import ErrorBoundary from '../ui/ErrorBoundary'; import ContextGroup from './ContextGroup'; import ContextSection from './ContextSection'; import ContextSections from './ContextSections'; import Body from './sections/Body'; import Browser from "./sections/Browser"; import Cookies from './sections/Cookies'; import Files from './sections/Files'; import Git from './sections/Git'; import Headers from './sections/Headers'; import LivewireCalls from './sections/LivewireCalls'; import LivewireComponent from './sections/LivewireComponent'; import LivewireData from './sections/LivewireData'; import LivewireMemo from './sections/LivewireMemo'; import LivewireUpdates from './sections/LivewireUpdates'; import QueryString from './sections/QueryString'; import Request from './sections/Request'; import Routing from './sections/Routing'; import Session from './sections/Session'; import User from './sections/User'; import Versions from './sections/Versions'; import View from './sections/View'; export default function Context() { const errorOccurrence = useContext(ErrorOccurrenceContext); const context = errorOccurrence.context_items; const requestData = context.request_data; return (
{(context.route || context.view || context.laravel_context || context.arguments || context.job) && ( {context.route && ( } children={} /> )} {context.view && ( } children={} /> )} {context.laravel_context && ( } children={} /> )} {context.arguments && ( } children={} /> )} {context.job && ( } children={} /> )} )} {context.request && ( {!!context.request.useragent && ( } children={} /> )} {context.headers && ( } children={} /> )} {context.request_data && !!Object.values(context.request_data.queryString || []).length && ( } children={} /> )} {!!context.request_data?.body && ( } children={} /> )} {!!requestData?.files?.length && ( } children={} /> )} {!!context.session?.length && ( } children={} /> )} {!!context.cookies?.length && ( } children={} /> )} )} {context.livewire && context.livewire.length > 0 && ( {context.livewire.map((component) => ( } >
} /> {component.updates.length > 0 && ( } /> )} {!!(component.calls && component.calls.length > 0) && ( } /> )} } /> {(component.memo) && } />}
))}
)} {!!(context.user || context.git || context.env || errorOccurrence.application_version || context.exception) && ( {context.user && ( } children={} /> )} {context.git && ( } children={} /> )} {!!(context.env || errorOccurrence.application_version) && ( } children={} /> )} {context.exception && ( } children={} /> )} )} {errorOccurrence.custom_context_items?.length > 0 && ( {errorOccurrence.custom_context_items.map((group) => ( } children={} /> ))} )}
); }