2022-11-28 02:00:28 +00:00
|
|
|
import { HelpCircle } from 'lucide-react';
|
2022-12-04 20:47:43 +00:00
|
|
|
import clsx from 'clsx';
|
2022-09-02 00:42:48 +00:00
|
|
|
|
2022-11-13 08:10:18 +00:00
|
|
|
import { FeatureId } from '@/react/portainer/feature-flags/enums';
|
2022-09-02 00:42:48 +00:00
|
|
|
|
2022-12-04 20:47:43 +00:00
|
|
|
import { TooltipWithChildren } from '@@/Tip/TooltipWithChildren';
|
2022-09-02 00:42:48 +00:00
|
|
|
import { getFeatureDetails } from '@@/BEFeatureIndicator/utils';
|
2022-08-10 04:12:20 +00:00
|
|
|
|
|
|
|
interface Props {
|
|
|
|
tooltipId: string;
|
2022-09-02 00:42:48 +00:00
|
|
|
featureId?: FeatureId;
|
2022-08-10 04:12:20 +00:00
|
|
|
}
|
|
|
|
|
2022-12-04 20:47:43 +00:00
|
|
|
export function LimitedToBeIndicator({ featureId, tooltipId }: Props) {
|
2022-09-02 00:42:48 +00:00
|
|
|
const { url } = getFeatureDetails(featureId);
|
|
|
|
|
2022-08-10 04:12:20 +00:00
|
|
|
return (
|
2022-12-04 20:47:43 +00:00
|
|
|
<div className="absolute left-0 top-0 w-full">
|
2023-02-12 21:04:24 +00:00
|
|
|
<div className="mx-auto flex max-w-fit items-center gap-1 rounded-b-lg bg-warning-4 py-1 px-3 text-sm">
|
2022-12-04 20:47:43 +00:00
|
|
|
<a href={url} target="_blank" rel="noopener noreferrer">
|
2022-12-15 14:25:13 +00:00
|
|
|
<span className="text-warning-9">BE Feature</span>
|
2022-12-04 20:47:43 +00:00
|
|
|
</a>
|
|
|
|
<TooltipWithChildren
|
|
|
|
position="bottom"
|
|
|
|
className={clsx(tooltipId, 'portainer-tooltip')}
|
|
|
|
heading="Business Edition feature."
|
|
|
|
message="This feature is currently limited to Business Edition users only."
|
|
|
|
>
|
|
|
|
<HelpCircle className="ml-1 !text-warning-7" aria-hidden="true" />
|
|
|
|
</TooltipWithChildren>
|
2022-08-10 04:12:20 +00:00
|
|
|
</div>
|
2022-12-04 20:47:43 +00:00
|
|
|
</div>
|
2022-08-10 04:12:20 +00:00
|
|
|
);
|
|
|
|
}
|