aboutsummaryrefslogtreecommitdiff
path: root/src/components/Flex.tsx
blob: c36976724e25b91929211349856854b327bb1217 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { PropsWithChildren } from "react";
import type { React } from '../webpack/common';

export function Flex(props: React.PropsWithChildren<{
    flexDirection?: React.CSSProperties["flexDirection"];
    style?: React.CSSProperties;
}>) {
    props.style ??= {};
    props.style.flexDirection ||= props.flexDirection;
    props.style.gap ??= "1em";
    props.style.display = "flex";
    return (
        <div {...props}>
            {props.children}
        </div>
    );
}