feat: completed the product sidebar

This commit is contained in:
=
2025-07-02 01:16:48 +05:30
parent 09cdd5ec91
commit c66510f473
17 changed files with 749 additions and 435 deletions
@@ -0,0 +1,20 @@
import { ReactNode, ComponentType } from "react";
type ShouldWrapProps<T extends Record<string, any>> = {
children: ReactNode;
wrapper: ComponentType<T & { children: ReactNode }>;
isWrapped?: boolean;
} & T;
export const ShouldWrap = <T extends Record<string, any>>({
children,
wrapper: Wrapper,
isWrapped = false,
...wrapperProps
}: ShouldWrapProps<T>) => {
if (isWrapped) {
return <Wrapper {...(wrapperProps as any)}>{children}</Wrapper>;
}
return children;
};