1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- import styled from '@emotion/styled';
- import type {Location} from 'history';
- import Breadcrumbs, {Crumb, CrumbDropdown} from 'sentry/components/breadcrumbs';
- import {t} from 'sentry/locale';
- import space from 'sentry/styles/space';
- import {Organization} from 'sentry/types';
- import type {RouteWithName} from 'sentry/views/settings/components/settingsBreadcrumb/types';
- interface Props {
- location: Location;
- organization: Organization;
- projectSlug: string;
- routes: RouteWithName[];
- title: string;
- alertName?: string;
- alertType?: string;
- canChangeProject?: boolean;
- }
- function BuilderBreadCrumbs({title, alertName, projectSlug, organization}: Props) {
- const crumbs: (Crumb | CrumbDropdown)[] = [
- {
- to: `/organizations/${organization.slug}/alerts/rules/`,
- label: t('Alerts'),
- preservePageFilters: true,
- },
- {
- label: title,
- ...(alertName
- ? {
- to: `/organizations/${organization.slug}/alerts/${projectSlug}/wizard`,
- preservePageFilters: true,
- }
- : {}),
- },
- ];
- if (alertName) {
- crumbs.push({label: alertName});
- }
- return <StyledBreadcrumbs crumbs={crumbs} />;
- }
- const StyledBreadcrumbs = styled(Breadcrumbs)`
- font-size: 18px;
- margin-bottom: ${space(3)};
- `;
- export default BuilderBreadCrumbs;
|