rename methods

This commit is contained in:
tresabhi committed 2026-08-30 14:26:08 -05:00
1 parent ec161addab
commit 5f737d940d
111 files changed
+563 -413

No files matched your search

@@ -0,0 +1,14 @@
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>
);
};
}
+18
View File
@@ -0,0 +1,18 @@
import type { ReactNode } from "react";
import { LocaleProvider } from "../hooks/useLocale";
interface WithLocaleProps {
locale: string;
}
export function withLocale<Props extends object>(
Component: (props: Props) => ReactNode,
) {
return function ({ locale, ...props }: Props & WithLocaleProps) {
return (
<LocaleProvider locale={locale}>
<Component {...(props as Props)} />
</LocaleProvider>
);
};
}