mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-14 13:16:11 +01:00
feat: some guessing mechanics
This commit is contained in:
1 parent
46441d74d8
commit
232f24181f
10 files changed
+265
-76
No files matched your search
@@ -0,0 +1,34 @@
|
||||
import {
|
||||
Badge,
|
||||
Button,
|
||||
Flex,
|
||||
type ButtonProps,
|
||||
type FlexProps,
|
||||
} from '@radix-ui/themes';
|
||||
import type { ReactNode } from 'react';
|
||||
|
||||
function Root(props: FlexProps) {
|
||||
return <Flex direction="column" gap="2" width="100%" {...props} />;
|
||||
}
|
||||
|
||||
interface ItemProps extends ButtonProps {
|
||||
text: string;
|
||||
discriminator?: ReactNode;
|
||||
}
|
||||
|
||||
function Item({ text, discriminator, ...props }: ItemProps) {
|
||||
return (
|
||||
<Button variant="ghost" {...props} highContrast>
|
||||
<Flex
|
||||
justify={discriminator === undefined ? 'center' : 'between'}
|
||||
width="100%"
|
||||
gap="2"
|
||||
>
|
||||
{text}
|
||||
{discriminator !== undefined && <Badge>{discriminator}</Badge>}
|
||||
</Flex>
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
|
||||
export const SearchResults = { Root, Item };
|
||||
Reference in new issue
Block a user