mirror of
https://github.com/aykhans/slash-e.git
synced 2025-04-21 06:13:33 +00:00
26 lines
651 B
TypeScript
26 lines
651 B
TypeScript
import { Tooltip } from "@mui/joy";
|
|
import { useWorkspaceStore } from "@/stores";
|
|
import { FeatureType } from "@/stores/workspace";
|
|
import Icon from "./Icon";
|
|
|
|
interface Props {
|
|
feature: FeatureType;
|
|
className?: string;
|
|
}
|
|
|
|
const FeatureBadge = ({ feature, className }: Props) => {
|
|
const workspaceStore = useWorkspaceStore();
|
|
const isFeatureEnabled = workspaceStore.checkFeatureAvailable(feature);
|
|
|
|
if (isFeatureEnabled) {
|
|
return null;
|
|
}
|
|
return (
|
|
<Tooltip title="This feature is not available on your plan." className={className} placement="top" arrow>
|
|
<Icon.Sparkles />
|
|
</Tooltip>
|
|
);
|
|
};
|
|
|
|
export default FeatureBadge;
|