mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-10-30 14:49:14 +00:00
34 lines
779 B
TypeScript
34 lines
779 B
TypeScript
import styled from '@emotion/styled';
|
|
|
|
import Avatar from 'sentry/components/avatar';
|
|
import {space} from 'sentry/styles/space';
|
|
import type {OrganizationSummary, Project} from 'sentry/types';
|
|
import {getParentKey} from 'sentry/views/settings/account/notifications/utils';
|
|
|
|
type Props = {
|
|
notificationType: string;
|
|
parent: OrganizationSummary | Project;
|
|
};
|
|
|
|
// TODO(mgaeta): Infer parentKey from parent.
|
|
function ParentLabel({notificationType, parent}: Props) {
|
|
return (
|
|
<FieldLabel>
|
|
<Avatar
|
|
{...{
|
|
[getParentKey(notificationType)]: parent,
|
|
}}
|
|
/>
|
|
<span>{parent.slug}</span>
|
|
</FieldLabel>
|
|
);
|
|
}
|
|
|
|
const FieldLabel = styled('div')`
|
|
display: flex;
|
|
gap: ${space(0.5)};
|
|
line-height: 16px;
|
|
`;
|
|
|
|
export default ParentLabel;
|