mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-12-04 23:32:54 +01:00
14 lines
340 B
TypeScript
14 lines
340 B
TypeScript
import type { ReactNode } from "react";
|
|||
|
|
import { ErrorWrapper } from "../components/ErrorWrapper";
|
||
|
|
|
||
|
|
export function withErrorWrapper<Props extends object>(
|
||
|
|
Component: (props: Props) => ReactNode,
|
||
|
|
) {
|
||
|
|
return function (props: Props) {
|
||
|
|
return (
|
||
|
|
<ErrorWrapper>
|
||
|
|
<Component {...props} />
|
||
|
|
</ErrorWrapper>
|
||
|
|
);
|
||
|
|
};
|
||
|
|
}
|