mirror of
https://github.com/pterodactyl/panel.git
synced 2026-12-01 11:55:51 -05:00
10 lines
354 B
TypeScript
10 lines
354 B
TypeScript
import { StyledComponent } from 'styled-components/macro';
|
|
|
|
export const withSubComponents = <C extends StyledComponent<any, any>, P extends Record<string, any>> (component: C, properties: P): C & P => {
|
|
Object.keys(properties).forEach((key: keyof P) => {
|
|
(component as any)[key] = properties[key];
|
|
});
|
|
|
|
return component as C & P;
|
|
};
|