mirror of
https://github.com/stefanpejcic/openpanel
synced 2025-06-26 18:28:26 +00:00
fork refine
This commit is contained in:
23
documentation/src/components/ui-conditional/index.tsx
Normal file
23
documentation/src/components/ui-conditional/index.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
import React from "react";
|
||||
import { PreferredUIPackage } from "../../context/TutorialUIPackageContext/index";
|
||||
import { useTutorialUIPackage } from "../../hooks/use-tutorial-ui-package";
|
||||
|
||||
type Props = {
|
||||
is?: PreferredUIPackage;
|
||||
children: React.ReactNode;
|
||||
};
|
||||
|
||||
const UIConditional: React.FC<React.PropsWithChildren<Props>> = ({
|
||||
is,
|
||||
children,
|
||||
}) => {
|
||||
const { current } = useTutorialUIPackage();
|
||||
|
||||
if (is && current === is) {
|
||||
return <>{children}</>;
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
export default UIConditional;
|
||||
Reference in New Issue
Block a user