react-code-dataset / react-instantsearch /packages /react-instantsearch-hooks-web /src /widgets /PoweredBy.tsx
| import React from 'react'; | |
| import { usePoweredBy } from 'react-instantsearch-hooks'; | |
| import { PoweredBy as PoweredByUiComponent } from '../ui/PoweredBy'; | |
| import type { PoweredByProps as PoweredByUiComponentProps } from '../ui/PoweredBy'; | |
| type UiProps = Pick<PoweredByUiComponentProps, 'url'>; | |
| export type PoweredByProps = Omit<PoweredByUiComponentProps, keyof UiProps>; | |
| export function PoweredBy(props: PoweredByProps) { | |
| const { url } = usePoweredBy(); | |
| const uiProps: UiProps = { | |
| url, | |
| }; | |
| return <PoweredByUiComponent {...props} {...uiProps} />; | |
| } | |