-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Copy pathDialogHeader.tsx
30 lines (27 loc) · 927 Bytes
/
DialogHeader.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import type { FeedbackInternalOptions } from '@sentry/types';
// biome-ignore lint/nursery/noUnusedImports: reason
import { h } from 'preact'; // eslint-disable-line @typescript-eslint/no-unused-vars
import type { VNode } from 'preact';
import { useMemo } from 'preact/hooks';
import { SentryLogo } from './SentryLogo';
export interface Props {
options: FeedbackInternalOptions;
}
export function DialogHeader({ options }: Props): VNode {
const logoHtml = useMemo(() => ({ __html: SentryLogo().outerHTML }), []);
return (
<h2 class="dialog__header">
<span class="dialog__title">{options.formTitle}</span>
{options.showBranding ? (
<a
class="brand-link"
target="_blank"
href="https://sentry.io/welcome/"
title="Powered by Sentry"
rel="noopener noreferrer"
dangerouslySetInnerHTML={logoHtml}
/>
) : null}
</h2>
);
}