// deno-lint-ignore no-explicit-any
export function withSubComponents<A, B extends Record<string, any>>(
  component: A,
  subcomponents: B,
): A & B {
  Object.keys(subcomponents).forEach((key) => {
    // deno-lint-ignore no-explicit-any
    (component as any)[key] = (subcomponents as any)[key];
  });
  return component as A & B;
}
