mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-10-30 14:49:14 +00:00
28 lines
840 B
TypeScript
28 lines
840 B
TypeScript
import {cloneElement, isValidElement} from 'react';
|
|
|
|
import Feature from 'sentry/components/acl/feature';
|
|
import NoProjectMessage from 'sentry/components/noProjectMessage';
|
|
import type {Organization} from 'sentry/types';
|
|
import withOrganization from 'sentry/utils/withOrganization';
|
|
|
|
type Props = {
|
|
organization: Organization;
|
|
children?: React.ReactNode;
|
|
};
|
|
|
|
function TeamInsightsContainer({children, organization}: Props) {
|
|
return (
|
|
<Feature organization={organization} features="team-insights">
|
|
<NoProjectMessage organization={organization}>
|
|
{children && isValidElement(children)
|
|
? cloneElement<any>(children, {
|
|
organization,
|
|
})
|
|
: (children as React.ReactChild)}
|
|
</NoProjectMessage>
|
|
</Feature>
|
|
);
|
|
}
|
|
|
|
export default withOrganization(TeamInsightsContainer);
|