mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-20 04:14:12 +01:00
migrated embed
This commit is contained in:
98 files changed
+1979
-1376
No files matched your search
@@ -0,0 +1,38 @@
|
||||
import type { ComponentProps, ReactNode } from "react";
|
||||
import { classNames } from "../../ui/classNames";
|
||||
import { Badge } from "../Badge";
|
||||
import { Button, type ButtonProps } from "../Button";
|
||||
import { Text } from "../Text";
|
||||
import styles from "./index.module.css";
|
||||
|
||||
function Root({ className, ...props }: ComponentProps<"div">) {
|
||||
return <div className={classNames(styles.root, className)} {...props} />;
|
||||
}
|
||||
|
||||
interface ItemProps extends Omit<ButtonProps, "prefix"> {
|
||||
prefix?: ReactNode;
|
||||
text: string;
|
||||
discriminator?: ReactNode;
|
||||
}
|
||||
|
||||
function Item({ text, discriminator, prefix, className, ...props }: ItemProps) {
|
||||
return (
|
||||
<Button
|
||||
variant="ghost"
|
||||
{...props}
|
||||
highContrast
|
||||
className={classNames(styles.item, className)}
|
||||
>
|
||||
{prefix}
|
||||
<Text>{text}</Text>
|
||||
{discriminator !== undefined && (
|
||||
<>
|
||||
<div className={styles.spacer} />
|
||||
<Badge>{discriminator}</Badge>
|
||||
</>
|
||||
)}
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
|
||||
export const SearchResults = { Root, Item };
|
||||
Reference in new issue
Block a user