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.1 KB
Raw Blame
import type { FC } from 'react'
import { CopyFeedback } from '@/app/components/base/copy-feedback'

type CardProps = {
  log: { role: string; text: string }[]
}
const Card: FC<CardProps> = ({ log }) => {
  return (
    <>
      {log.length === 1 && (
        <div className="px-4 py-2">
          <div className="whitespace-pre-line text-text-secondary">{log[0]!.text}</div>
        </div>
      )}
      {log.length > 1 && (
        <div>
          {log.map((item, index) => (
            <div
              key={index}
              className="group/card mb-2 rounded-xl px-4 pt-2 pb-4 last-of-type:mb-0 hover:bg-state-base-hover"
            >
              <div className="flex h-8 items-center justify-between">
                <div className="font-semibold text-indigo-800">{item.role.toUpperCase()}</div>
                <CopyFeedback className="hidden group-hover/card:block" content={item.text} />
              </div>
              <div className="whitespace-pre-line text-text-secondary">{item.text}</div>
            </div>
          ))}
        </div>
      )}
    </>
  )
}

export default Card