* wip: add spotlight * feat: add spotlight with registration hook and group chips * chore: address pull request feedback * docs: add documentation for usage of spotlight actions * fix: deepsource issue JS-0415 * feat: add support for dependencies of spotlight actions * fix: lockfile broken * feat: add hover effect for spotlight action * docs: Add documentation about dependency array * refactor: remove test spotlight actions, disallow all as group for actions * fix: type issues * chore: address pull request feedback
19 lines
505 B
TypeScript
19 lines
505 B
TypeScript
import React from "react";
|
|
|
|
type PropsWithChildren = Required<React.PropsWithChildren>;
|
|
|
|
export const composeWrappers = (
|
|
wrappers: React.FunctionComponent<PropsWithChildren>[],
|
|
): React.FunctionComponent<PropsWithChildren> => {
|
|
return wrappers
|
|
.reverse()
|
|
.reduce((Acc, Current): React.FunctionComponent<PropsWithChildren> => {
|
|
// eslint-disable-next-line react/display-name
|
|
return (props) => (
|
|
<Current>
|
|
<Acc {...props} />
|
|
</Current>
|
|
);
|
|
});
|
|
};
|