Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

1.6 KB
Raw Blame
import type { Meta, StoryObj } from '@storybook/nextjs-vite'
import type { IChatItem } from '@/app/components/base/chat/chat/type'
import { fn } from 'storybook/test'
import PromptLogModal from '.'

type PromptLogModalProps = React.ComponentProps<typeof PromptLogModal>

const mockLogItem: IChatItem = {
  id: 'message-1',
  isAnswer: true,
  content: 'Summarize our meeting notes about launch blockers.',
  log: [
    {
      role: 'system',
      text: 'You are an assistant that extracts key launch blockers from the dialogue.',
    },
    {
      role: 'user',
      text: 'Team discussed QA, marketing assets, and infra readiness. Highlight risks.',
    },
    {
      role: 'assistant',
      text: 'Blocking items:\n1. QA needs staging data by Friday.\n2. Marketing awaiting final visuals.\n3. Infra rollout still missing approval.',
    },
  ],
}

const PromptLogPreview = (props: PromptLogModalProps) => {
  return (
    <div className="relative min-h-135 w-full bg-background-default-subtle p-6">
      <PromptLogModal {...props} currentLogItem={mockLogItem} />
    </div>
  )
}

const meta = {
  title: 'Base/Feedback/PromptLogModal',
  component: PromptLogPreview,
  parameters: {
    layout: 'fullscreen',
    docs: {
      description: {
        component:
          'Shows the prompt and message transcript used for a chat completion, with copy-to-clipboard support for single prompts.',
      },
    },
  },
  args: {
    width: 960,
    onCancel: fn(),
  },
  tags: ['autodocs'],
} satisfies Meta<typeof PromptLogPreview>

export default meta
type Story = StoryObj<typeof meta>

export const Playground: Story = {}