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.4 KB
Raw Blame
'use client'

import type { ReactNode } from 'react'
import { IconButton } from '@langgenius/dify-ui/icon-button'
import { PopoverClose, PopoverTitle } from '@langgenius/dify-ui/popover'
import { useTranslation } from 'react-i18next'

type PluginSidecarPanelProps = {
  children: ReactNode
  footer?: ReactNode
  title: ReactNode
}

export function PluginSidecarPanel({ children, footer, title }: PluginSidecarPanelProps) {
  const { t } = useTranslation(['common'])

  return (
    <div className="flex w-90 flex-col items-start overflow-hidden rounded-2xl border-[0.5px] border-components-panel-border bg-components-panel-bg shadow-2xl shadow-shadow-shadow-9">
      <div className="relative flex w-full shrink-0 flex-col gap-0.5 px-3 pt-3.5 pb-1">
        <div className="flex w-full shrink-0 items-start">
          <div className="flex min-w-0 flex-1 flex-col items-start pr-8 pl-1">
            <PopoverTitle className="w-full system-xl-semibold text-text-primary">
              {title}
            </PopoverTitle>
          </div>
        </div>
        <PopoverClose
          render={
            <IconButton
              aria-label={t(($) => $['operation.close'], { ns: 'common' })}
              size="lg"
              className="absolute top-2.5 right-2.5"
            >
              <span aria-hidden className="i-ri-close-line size-4" />
            </IconButton>
          }
        />
      </div>
      {children}
      {footer}
    </div>
  )
}