mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
FSL-1.0-Apache-2.0 grants us the code, not the name. "Sentry" is Functional Software's trademark, so every place the running app says it to a user -- page titles, onboarding, empty states, toasts, settings copy, the self-hosted footer -- now says Sentinel. Attribution is the other half of the deal and stays untouched: upstream copyright headers, LICENSE, NOTICE. So does anything where the mark is a fact rather than a brand -- @sentry/* packages, sentry-cli, the wizard and bundler plugins, docs.sentry.io, the whole gettingStartedDocs tree. Renaming those would leave instructions that no longer work. Nothing structural moved. No import, identifier, route path, feature flag, API field or test id changed; the diff is 312 lines in and 312 out. Colocated specs were updated in lockstep with the copy they assert. Marketing and community links point at hanzo.ai, only where a real page exists to point at. Co-authored-by: Hanzo Dev <[email protected]>
96 lines
2.3 KiB
TypeScript
96 lines
2.3 KiB
TypeScript
import styled from '@emotion/styled';
|
|
import * as Sentry from '@sentry/react';
|
|
|
|
import {Button} from 'sentry/components/button';
|
|
import ButtonBar from 'sentry/components/buttonBar';
|
|
import {IconFlag} from 'sentry/icons';
|
|
import {t} from 'sentry/locale';
|
|
import {space} from 'sentry/styles/space';
|
|
|
|
type Props = {
|
|
/**
|
|
* Error heading
|
|
*/
|
|
heading: React.ReactNode;
|
|
className?: string;
|
|
/**
|
|
* Hide support links in footer of error message
|
|
*/
|
|
hideSupportLinks?: boolean;
|
|
/**
|
|
* Detailed error explanation
|
|
*/
|
|
message?: React.ReactNode;
|
|
/**
|
|
* Retry callback
|
|
*/
|
|
onRetry?: (e: React.MouseEvent) => void;
|
|
};
|
|
|
|
function openFeedback(e: React.MouseEvent) {
|
|
e.preventDefault();
|
|
Sentry.showReportDialog();
|
|
}
|
|
|
|
function DetailedError({className, heading, message, onRetry, hideSupportLinks}: Props) {
|
|
const showFooter = !!onRetry || !hideSupportLinks;
|
|
const hasLastEvent = !!Sentry.lastEventId();
|
|
|
|
return (
|
|
<Wrapper className={className}>
|
|
<ErrorHeading>
|
|
<IconFlag size="md" color="errorText" />
|
|
{heading}
|
|
</ErrorHeading>
|
|
|
|
{message}
|
|
|
|
{showFooter && (
|
|
<ErrorFooter>
|
|
<div>{onRetry && <Button onClick={onRetry}>{t('Retry')}</Button>}</div>
|
|
|
|
{!hideSupportLinks && (
|
|
<ButtonBar gap={1.5}>
|
|
{hasLastEvent && (
|
|
<Button priority="link" onClick={openFeedback}>
|
|
{t('Fill out a report')}
|
|
</Button>
|
|
)}
|
|
<Button priority="link" external href="https://status.hanzo.ai">
|
|
{t('Service status')}
|
|
</Button>
|
|
<Button priority="link" external href="https://hanzo.ai/support">
|
|
{t('Contact support')}
|
|
</Button>
|
|
</ButtonBar>
|
|
)}
|
|
</ErrorFooter>
|
|
)}
|
|
</Wrapper>
|
|
);
|
|
}
|
|
|
|
const Wrapper = styled('div')`
|
|
margin: ${space(2)} auto 0 auto;
|
|
padding: ${space(2)};
|
|
width: max-content;
|
|
`;
|
|
|
|
const ErrorHeading = styled('h4')`
|
|
display: flex;
|
|
gap: ${space(1.5)};
|
|
align-items: center;
|
|
margin-left: calc(-1 * (${p => p.theme.iconSizes.md} + ${space(1.5)}));
|
|
`;
|
|
|
|
const ErrorFooter = styled('div')`
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-top: ${space(2)};
|
|
border-top: 1px solid ${p => p.theme.innerBorder};
|
|
padding-top: ${space(2)};
|
|
`;
|
|
|
|
export default DetailedError;
|