Template
- Gate the assistant on NEXT_PUBLIC_ENABLE_AI=1 (UI only; the /api/chat route still responds if called directly) - Chat model is openai/gpt-5.6-luna-pro with reasoning requested and sendReasoning enabled, rendered via the Reasoning component - Suggestion chips and reasoning come from ai-elements; attachments gain hover-card previews, left alignment, and render under the user message - Launcher: plain Button when closed, magicui RainbowButton when open - Tool results replace the collapsible Tool UI with a shimmer while running and a muted icon + summary line after, plus product previews - Commerce icons in place of the folder icon for collections - Add a thin announcement bar above the header; footer splits links and socials onto separate rows and clears the launcher corner - Add the shadcn base layer so Tailwind v4's bare `border` picks up the theme colour instead of currentColor Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016jWbNNJLksC1QG8z8845FX
58 lines
1.3 KiB
TypeScript
58 lines
1.3 KiB
TypeScript
"use client";
|
|
|
|
import { Button } from "@/components/ui/button";
|
|
import {
|
|
ScrollArea,
|
|
ScrollBar,
|
|
} from "@/components/ui/scroll-area";
|
|
import { cn } from "@/lib/utils";
|
|
import type { ComponentProps } from "react";
|
|
import { useCallback } from "react";
|
|
|
|
export type SuggestionsProps = ComponentProps<typeof ScrollArea>;
|
|
|
|
export const Suggestions = ({
|
|
className,
|
|
children,
|
|
...props
|
|
}: SuggestionsProps) => (
|
|
<ScrollArea className="w-full overflow-x-auto whitespace-nowrap" {...props}>
|
|
<div className={cn("flex w-max flex-nowrap items-center gap-2", className)}>
|
|
{children}
|
|
</div>
|
|
<ScrollBar className="hidden" orientation="horizontal" />
|
|
</ScrollArea>
|
|
);
|
|
|
|
export type SuggestionProps = Omit<ComponentProps<typeof Button>, "onClick"> & {
|
|
suggestion: string;
|
|
onClick?: (suggestion: string) => void;
|
|
};
|
|
|
|
export const Suggestion = ({
|
|
suggestion,
|
|
onClick,
|
|
className,
|
|
variant = "outline",
|
|
size = "sm",
|
|
children,
|
|
...props
|
|
}: SuggestionProps) => {
|
|
const handleClick = useCallback(() => {
|
|
onClick?.(suggestion);
|
|
}, [onClick, suggestion]);
|
|
|
|
return (
|
|
<Button
|
|
className={cn("cursor-pointer rounded-full px-4", className)}
|
|
onClick={handleClick}
|
|
size={size}
|
|
type="button"
|
|
variant={variant}
|
|
{...props}
|
|
>
|
|
{children || suggestion}
|
|
</Button>
|
|
);
|
|
};
|