aboutsummaryrefslogtreecommitdiff
path: root/src/components/Flex.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/Flex.tsx')
-rw-r--r--src/components/Flex.tsx17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/components/Flex.tsx b/src/components/Flex.tsx
new file mode 100644
index 0000000..c369767
--- /dev/null
+++ b/src/components/Flex.tsx
@@ -0,0 +1,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>
+ );
+}