AI Suggestions Panel

A panel showing AI-generated suggestions with accept/reject/modify actions, confidence scores, and batch operations.

Preview

Install Summary

Component Files

FilePath
ai-suggestions-panel.tsxcomponents/ai-assist/ai-suggestions-panel/ai-suggestions-panel.tsx
suggestion-card.tsxcomponents/ai-assist/ai-suggestions-panel/suggestion-card.tsx
suggestion-actions.tsxcomponents/ai-assist/ai-suggestions-panel/suggestion-actions.tsx
types.tscomponents/ai-assist/ai-suggestions-panel/types.ts
index.tscomponents/ai-assist/ai-suggestions-panel/index.ts

Utility Files

FilePath
design-tokens.tslib/design-tokens.ts

Dependencies

Install these dependencies before using the component:

Terminal
bash
npx shadcn@latest add button badge collapsible
Terminal
bash
npm install @phosphor-icons/react

Installation

Component Files

The component consists of the following files:

1. ai-suggestions-panel.tsx

ai-suggestions-panel.tsx
tsx
"use client";

import { useState } from "react";
import { Lightbulb } from "@phosphor-icons/react";
import { Button } from "@/components/ui/button";

2. suggestion-card.tsx

suggestion-card.tsx
tsx
"use client";

import {
  Check,
  X,

3. suggestion-actions.tsx

suggestion-actions.tsx
tsx
"use client";

import { Check, X } from "@phosphor-icons/react";
import { Button } from "@/components/ui/button";

4. types.ts

types.ts
tsx
export interface AISuggestion {
  id: string;
  title: string;
  description: string;
  category?: string;

5. index.ts

index.ts
tsx
export { AISuggestionsPanel } from "./ai-suggestions-panel";
export type { AISuggestionsPanelProps, AISuggestion } from "./types";









Shared Utilities

This component uses shared utility functions. These are included in the bundle above:

design-tokens.ts

design-tokens.ts
tsx
// Border radius
export const radius = {
  card: "rounded-xl",
  badge: "rounded-full",
  button: "rounded-lg",

Usage

app/page.tsx
tsx
"use client";

import { AISuggestionsPanel, type AISuggestion } from "@/components/ai-assist";

const suggestions: AISuggestion[] = [