Vencord/src/components/Flex.tsx
megumin 5625d63e46
Settings 2.0 (#107)
Co-authored-by: Vendicated <vendicated@riseup.net>
2022-10-17 20:18:25 +01:00

17 lines
493 B
TypeScript

import type { React } from "../webpack/common";
export function Flex(props: React.PropsWithChildren<{
flexDirection?: React.CSSProperties["flexDirection"];
style?: React.CSSProperties;
className?: string;
} & React.HTMLProps<HTMLDivElement>>) {
props.style ??= {};
props.style.flexDirection ||= props.flexDirection;
props.style.gap ??= "1em";
props.style.display = "flex";
return (
<div {...props}>
{props.children}
</div>
);
}