15 lines
350 B
TypeScript
15 lines
350 B
TypeScript
import React from "react";
|
|
import { Consumer } from "@docspace/shared/utils";
|
|
|
|
export function withLayoutSize(Component: React.JSX.ElementType) {
|
|
return function LayoutSizeComponent(props: {}) {
|
|
return (
|
|
<Consumer>
|
|
{(context) => {
|
|
return <Component {...props} {...context} />;
|
|
}}
|
|
</Consumer>
|
|
);
|
|
};
|
|
}
|