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

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