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 { loadCreatorProfile } from '@/app/components/plugins/marketplace/creator-profile/data.server'
import DifyCreatorProfile from '@/app/components/plugins/marketplace/creator-profile/dify-profile'
import MarketplaceInstallPermissionProvider from '@/app/components/plugins/marketplace/marketplace-install-permission-provider'
import { getLocaleOnServer } from '@/i18n/server'
import { notFound } from '@/next/navigation'

type CreatorPageSearchParams = {
  publisher_type?: string
  sort_by?: string
  sort_order?: string
}

type CreatorProfilePageProps = {
  params: Promise<{ uniqueHandle: string }>
  searchParams: Promise<CreatorPageSearchParams>
}

// Sync route: async pages under this client shell Flight-double-resolve.
export default function CreatorProfilePage(props: CreatorProfilePageProps) {
  return (
    <div
      id="marketplace-container"
      className="flex h-full min-h-0 flex-col overflow-y-auto bg-background-default"
    >
      <CreatorProfileContent {...props} />
    </div>
  )
}

async function CreatorProfileContent({ params, searchParams }: CreatorProfilePageProps) {
  const [{ uniqueHandle }, query, locale] = await Promise.all([
    params,
    searchParams,
    getLocaleOnServer(),
  ])
  const loadedProfile = await loadCreatorProfile({
    uniqueHandle,
    publisherType: query.publisher_type,
    locale,
    sortBy: query.sort_by,
    sortOrder: query.sort_order,
  })

  if (!loadedProfile) notFound()

  return (
    <MarketplaceInstallPermissionProvider>
      <DifyCreatorProfile loadedProfile={loadedProfile} locale={locale} />
    </MarketplaceInstallPermissionProvider>
  )
}