1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-20 13:59:40 +02:00
portainer/app/react/components/BEFeatureIndicator/BEFeatureIndicator.tsx
Richard Wei a247db7e93
feat(ui): added teaser styling for CE EE-3780 (#7323)
* added teaser styling for CE
2022-08-12 12:03:30 +12:00

42 lines
971 B
TypeScript

import { PropsWithChildren } from 'react';
import clsx from 'clsx';
import { Briefcase } from 'react-feather';
import './BEFeatureIndicator.css';
import { FeatureId } from '@/portainer/feature-flags/enums';
import { getFeatureDetails } from './utils';
export interface Props {
featureId?: FeatureId;
showIcon?: boolean;
className?: string;
}
export function BEFeatureIndicator({
featureId,
children,
showIcon = true,
className = '',
}: PropsWithChildren<Props>) {
const { url, limitedToBE } = getFeatureDetails(featureId);
if (!limitedToBE) {
return null;
}
return (
<a
className={clsx('be-indicator vertical-center', className)}
href={url}
target="_blank"
rel="noopener noreferrer"
>
{children}
{showIcon && <Briefcase className="icon icon-sm vertical-center" />}
<span className="be-indicator-label break-words space-left">
Business Edition Feature
</span>
</a>
);
}