Vencord/src/components/Flex.tsx

18 lines
493 B
TypeScript
Raw Normal View History

import type { React } from "../webpack/common";
2022-09-27 10:57:46 -04:00
export function Flex(props: React.PropsWithChildren<{
flexDirection?: React.CSSProperties["flexDirection"];
style?: React.CSSProperties;
2022-09-30 18:42:50 -04:00
className?: string;
} & React.HTMLProps<HTMLDivElement>>) {
2022-09-27 10:57:46 -04:00
props.style ??= {};
props.style.flexDirection ||= props.flexDirection;
props.style.gap ??= "1em";
props.style.display = "flex";
return (
<div {...props}>
{props.children}
</div>
);
}