diff options
Diffstat (limited to 'src/view/com/util/NoSnippetWrapper.tsx')
-rw-r--r-- | src/view/com/util/NoSnippetWrapper.tsx | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/src/view/com/util/NoSnippetWrapper.tsx b/src/view/com/util/NoSnippetWrapper.tsx deleted file mode 100644 index fcf658249..000000000 --- a/src/view/com/util/NoSnippetWrapper.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import {type ViewProps} from 'react-native' -// @ts-expect-error untyped -import {unstable_createElement} from 'react-native-web' - -import {isWeb} from '#/platform/detection' - -interface Props extends ViewProps { - enabled: boolean -} - -/** - * NoSnippetWrapper prevents search engines from displaying snippets of its content. - * - * If running on web and enabled, wraps children in a <div> with data-nosnippet attribute. - * Otherwise, renders children directly. - * - * @param enabled - Whether to apply the data-nosnippet attribute. - * @param viewProps - Additional props for the wrapper element. - */ -export function NoSnippetWrapper({enabled, ...viewProps}: Props) { - if (isWeb && enabled) { - return unstable_createElement('div', { - ...viewProps, - 'data-nosnippet': '', - }) - } - - return <>{viewProps.children}</> -} |