dify/web/app/components/plugins/plugin-page/plugins-panel.tsx

43 lines
1.4 KiB
TypeScript
Raw Normal View History

2024-10-11 16:15:24 +08:00
'use client'
2024-10-16 15:37:32 +08:00
import { useState } from 'react'
2024-10-19 14:18:51 +08:00
import type { EndpointListItem, PluginDetail } from '../types'
2024-10-18 14:02:40 +08:00
import type { FilterState } from './filter-management'
import FilterManagement from './filter-management'
2024-10-17 15:21:56 +08:00
import List from './list'
2024-10-19 14:18:51 +08:00
import PluginDetailPanel from '@/app/components/plugins/plugin-detail-panel'
import { toolNotion, toolNotionEndpoints } from '@/app/components/plugins/plugin-detail-panel/mock'
2024-10-17 15:21:56 +08:00
2024-10-11 16:15:24 +08:00
const PluginsPanel = () => {
2024-10-18 14:02:40 +08:00
const handleFilterChange = (filters: FilterState) => {
//
}
2024-10-16 17:30:51 +08:00
const [currentPluginDetail, setCurrentPluginDetail] = useState<PluginDetail | undefined>(toolNotion as any)
2024-10-19 14:18:51 +08:00
const [currentPluginEndpoints, setCurrentEndpoints] = useState<EndpointListItem[]>(toolNotionEndpoints as any)
2024-10-11 16:15:24 +08:00
return (
<>
<div className='flex flex-col pt-1 pb-3 px-12 justify-center items-start gap-3 self-stretch'>
<div className='h-px self-stretch bg-divider-subtle'></div>
2024-10-18 14:02:40 +08:00
<FilterManagement
onFilterChange={handleFilterChange}
/>
2024-10-11 16:15:24 +08:00
</div>
<div className='flex px-12 items-start content-start gap-2 flex-grow self-stretch flex-wrap'>
2024-10-18 14:02:40 +08:00
<div className='w-full'>
<List />
</div>
2024-10-11 16:15:24 +08:00
</div>
2024-10-19 14:18:51 +08:00
<PluginDetailPanel
pluginDetail={currentPluginDetail}
endpointList={currentPluginEndpoints}
onHide={() => {
setCurrentPluginDetail(undefined)
setCurrentEndpoints([])
}}
/>
2024-10-11 16:15:24 +08:00
</>
)
}
export default PluginsPanel