(opts: PromptProps | LegacyPromptProps)
| 303 | export function Block(opts: LegacyPromptProps): SolidNode |
| 304 | |
| 305 | export function Block(opts: PromptProps | LegacyPromptProps): SolidNode { |
| 306 | const [propsWithChildren, rest] = Solid.splitProps(opts, ['children']) |
| 307 | const args = _resolvePromptBlockerArgs(rest) |
| 308 | |
| 309 | const resolver = useBlocker(args) |
| 310 | const children = Solid.createMemo(() => { |
| 311 | const child = propsWithChildren.children |
| 312 | if (resolver && typeof child === 'function') return child(resolver()) |
| 313 | return child |
| 314 | }) |
| 315 | |
| 316 | return <>{children()}</> |
| 317 | } |
| 318 | |
| 319 | type LegacyPromptProps = { |
| 320 | blockerFn?: LegacyBlockerFn |
nothing calls this directly
no test coverage detected