Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

g1t.sh
33 linesCodeBlameRaw
1/**
2 * AI Elements' Suggestion (registry.ai-sdk.dev/suggestion.json), in g1t's
3 * tokens: what someone might ask first, as quiet pills that wrap.
4 */
5import type { ComponentProps } from "react";
6
7import { cn } from "../../lib/cn";
8import { Button } from "../ui/button";
9
10export function Suggestions({ className, ...props }: ComponentProps<"div">) {
11 return <div role="list" className={cn("flex flex-wrap gap-2", className)} {...props} />;
12}
13
14export function Suggestion({
15 suggestion,
16 onPick,
17 className,
18 ...props
19}: Omit<ComponentProps<typeof Button>, "onClick"> & { suggestion: string; onPick: (suggestion: string) => void }) {
20 return (
21 <Button
22 type="button"
23 role="listitem"
24 variant="outline"
25 size="sm"
26 onClick={() => onPick(suggestion)}
27 className={cn("h-auto rounded-full px-3 py-1.5 text-left font-normal whitespace-normal text-fg-soft", className)}
28 {...props}
29 >
30 {suggestion}
31 </Button>
32 );
33}