MCPcopy Index your code
hub / github.com/anomalyco/opencode / trigger

Function trigger

packages/session-ui/src/components/basic-tool.tsx:182–252  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

180 }
181
182 const trigger = () => (
183 <div
184 data-component="tool-trigger"
185 data-clickable={props.clickable ? "true" : undefined}
186 data-hide-details={props.hideDetails ? "true" : undefined}
187 >
188 <div data-slot="basic-tool-tool-trigger-content">
189 <div data-slot="basic-tool-tool-info">
190 <Switch>
191 <Match when={dynamicTrigger !== undefined}>{dynamicTrigger}</Match>
192 <Match when={isTriggerTitle(props.trigger) && props.trigger}>
193 {(title) => (
194 <div data-slot="basic-tool-tool-info-structured">
195 <div data-slot="basic-tool-tool-info-main">
196 <span
197 data-slot="basic-tool-tool-title"
198 classList={{
199 [title().titleClass ?? ""]: !!title().titleClass,
200 }}
201 >
202 <TextShimmer text={title().title} active={pending()} />
203 </span>
204 <Show when={!pending()}>
205 <Show when={title().subtitle}>
206 <span
207 data-slot="basic-tool-tool-subtitle"
208 classList={{
209 [title().subtitleClass ?? ""]: !!title().subtitleClass,
210 clickable: !!props.onSubtitleClick,
211 }}
212 onClick={(e) => {
213 if (props.onSubtitleClick) {
214 e.stopPropagation()
215 props.onSubtitleClick()
216 }
217 }}
218 >
219 {title().subtitle}
220 </span>
221 </Show>
222 <Show when={title().args?.length}>
223 <For each={title().args}>
224 {(arg) => (
225 <span
226 data-slot="basic-tool-tool-arg"
227 classList={{
228 [title().argsClass ?? ""]: !!title().argsClass,
229 }}
230 >
231 {arg}
232 </span>
233 )}
234 </For>
235 </Show>
236 </Show>
237 </div>
238 <Show when={!pending() && title().action}>
239 <span data-slot="basic-tool-tool-action">{title().action}</span>

Callers 1

BasicToolFunction · 0.70

Calls 4

hasChildrenFunction · 0.85
isTriggerTitleFunction · 0.70
pendingFunction · 0.70
titleFunction · 0.50

Tested by

no test coverage detected