feat: some guessing mechanics

This commit is contained in:
tresabhi committed 2025-05-04 21:02:50 -05:00
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 };