From d636317ac60c36f6646ddb813b997bbd15b5ae04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Chy=C5=82a?= Date: Tue, 9 Jan 2024 12:56:43 +0100 Subject: [PATCH] fix: dropdown no options component (#716) * Fix no options import * Export no options props --- src/components/BaseSelect/NoOptions/NoOptions.tsx | 14 ++++++++++++++ .../{NoOptions.tsx => NoOptions/helpers.ts} | 14 +------------- src/components/BaseSelect/NoOptions/index.ts | 2 ++ 3 files changed, 17 insertions(+), 13 deletions(-) create mode 100644 src/components/BaseSelect/NoOptions/NoOptions.tsx rename src/components/BaseSelect/{NoOptions.tsx => NoOptions/helpers.ts} (54%) create mode 100644 src/components/BaseSelect/NoOptions/index.ts diff --git a/src/components/BaseSelect/NoOptions/NoOptions.tsx b/src/components/BaseSelect/NoOptions/NoOptions.tsx new file mode 100644 index 00000000..02fe15ad --- /dev/null +++ b/src/components/BaseSelect/NoOptions/NoOptions.tsx @@ -0,0 +1,14 @@ +import { ReactNode } from "react"; +import { Text } from "~/components"; + +export interface NoOptionsProps { + children: ReactNode; +} + +export const NoOptions = ({ children }: NoOptionsProps) => { + return ( + + {children} + + ); +}; diff --git a/src/components/BaseSelect/NoOptions.tsx b/src/components/BaseSelect/NoOptions/helpers.ts similarity index 54% rename from src/components/BaseSelect/NoOptions.tsx rename to src/components/BaseSelect/NoOptions/helpers.ts index a7b39eca..04a31ed9 100644 --- a/src/components/BaseSelect/NoOptions.tsx +++ b/src/components/BaseSelect/NoOptions/helpers.ts @@ -1,17 +1,5 @@ import { Children, ReactNode, isValidElement } from "react"; -import { Text } from "~/components"; - -interface NoOptionsProps { - children: ReactNode; -} - -export const NoOptions = ({ children }: NoOptionsProps) => { - return ( - - {children} - - ); -}; +import { NoOptions } from "./NoOptions"; export const hasNoOptions = (children: ReactNode): boolean => { let hasNoOptions = false; diff --git a/src/components/BaseSelect/NoOptions/index.ts b/src/components/BaseSelect/NoOptions/index.ts new file mode 100644 index 00000000..a20684c6 --- /dev/null +++ b/src/components/BaseSelect/NoOptions/index.ts @@ -0,0 +1,2 @@ +export * from "./NoOptions"; +export * from "./helpers";