mirror of
https://github.com/morten-olsen/refocus.dev.git
synced 2026-02-08 00:46:25 +01:00
20 lines
413 B
TypeScript
20 lines
413 B
TypeScript
import { useLinear } from '.';
|
|
|
|
const withLinear = <TProps extends object>(
|
|
Component: React.ComponentType<TProps>,
|
|
FallBack: React.ComponentType<object>,
|
|
) => {
|
|
const WrappedComponent: React.FC<TProps> = (props) => {
|
|
const linear = useLinear();
|
|
|
|
if (!linear.client) {
|
|
return <FallBack />;
|
|
}
|
|
return <Component {...props} />;
|
|
};
|
|
|
|
return WrappedComponent;
|
|
};
|
|
|
|
export { withLinear };
|