Skip to content

Commit

Permalink
fix: dropdown no options component (#716)
Browse files Browse the repository at this point in the history
* Fix no options import

* Export no options props
  • Loading branch information
poulch committed Jan 9, 2024
1 parent a59d67c commit d636317
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
14 changes: 14 additions & 0 deletions src/components/BaseSelect/NoOptions/NoOptions.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { ReactNode } from "react";
import { Text } from "~/components";

export interface NoOptionsProps {
children: ReactNode;
}

export const NoOptions = ({ children }: NoOptionsProps) => {
return (
<Text as="p" padding={2} textAlign="center" fontStyle="italic">
{children}
</Text>
);
};
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
import { Children, ReactNode, isValidElement } from "react";
import { Text } from "~/components";

interface NoOptionsProps {
children: ReactNode;
}

export const NoOptions = ({ children }: NoOptionsProps) => {
return (
<Text as="p" padding={2} textAlign="center" fontStyle="italic">
{children}
</Text>
);
};
import { NoOptions } from "./NoOptions";

export const hasNoOptions = (children: ReactNode): boolean => {
let hasNoOptions = false;
Expand Down
2 changes: 2 additions & 0 deletions src/components/BaseSelect/NoOptions/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./NoOptions";
export * from "./helpers";

1 comment on commit d636317

@vercel
Copy link

@vercel vercel bot commented on d636317 Jan 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.