diff options
Diffstat (limited to 'src/ui/objects/Badge.tsx')
| -rw-r--r-- | src/ui/objects/Badge.tsx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/ui/objects/Badge.tsx b/src/ui/objects/Badge.tsx new file mode 100644 index 0000000..e98ef0d --- /dev/null +++ b/src/ui/objects/Badge.tsx | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | import type { HTMLTag, Polymorphic } from "corvos/plugins/jsx.ts"; | ||
| 2 | |||
| 3 | import type { Props as ActionButtonProps } from "./ActionButton.tsx"; | ||
| 4 | |||
| 5 | import { ActionButton } from "./ActionButton.tsx"; | ||
| 6 | |||
| 7 | export type Props<Tag extends HTMLTag> = Polymorphic<{ | ||
| 8 | as?: Tag; | ||
| 9 | variant?: ActionButtonProps<Tag>["variant"]; | ||
| 10 | pill?: boolean; | ||
| 11 | selected?: boolean; | ||
| 12 | size?: ActionButtonProps<Tag>["size"]; | ||
| 13 | children?: JSX.Element; | ||
| 14 | }>; | ||
| 15 | |||
| 16 | export const Badge = <T extends HTMLTag = "span">({ as = "span" as T, ...props }: Props<T>) => ( | ||
| 17 | // deno-lint-ignore no-explicit-any | ||
| 18 | <ActionButton as={as} level="badge" {...(props as any)} /> | ||
| 19 | ); | ||
