Vencord/src/components/Flex.tsx

19 lines
502 B
TypeScript
Raw Normal View History

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