mirror of
https://github.com/langgenius/dify.git
synced 2026-05-13 08:57:28 +08:00
- add SplitPanel to share left/right shell and narrow menu handling - reuse InspectHeaderProps for tab header + actions across tabs - refactor variables/artifacts tabs to plug into shared split layout - align right-side header/close behavior and consolidate empty/loading flows
45 lines
1.1 KiB
TypeScript
45 lines
1.1 KiB
TypeScript
import type { FC, ReactNode } from 'react'
|
|
import type { InspectTab } from './types'
|
|
import { RiCloseLine } from '@remixicon/react'
|
|
import ActionButton from '@/app/components/base/action-button'
|
|
import TabHeader from './tab-header'
|
|
|
|
export type InspectHeaderProps = {
|
|
activeTab: InspectTab
|
|
onTabChange: (tab: InspectTab) => void
|
|
onClose: () => void
|
|
headerActions?: ReactNode
|
|
}
|
|
|
|
type InspectLayoutProps = InspectHeaderProps & {
|
|
children: ReactNode
|
|
}
|
|
|
|
const InspectLayout: FC<InspectLayoutProps> = ({
|
|
activeTab,
|
|
onTabChange,
|
|
onClose,
|
|
headerActions,
|
|
children,
|
|
}) => {
|
|
return (
|
|
<div className="flex h-full flex-col">
|
|
<div className="flex shrink-0 items-center justify-between">
|
|
<TabHeader activeTab={activeTab} onTabChange={onTabChange}>
|
|
{headerActions}
|
|
</TabHeader>
|
|
<div className="pr-2 pt-2">
|
|
<ActionButton onClick={onClose} aria-label="Close">
|
|
<RiCloseLine className="h-4 w-4" />
|
|
</ActionButton>
|
|
</div>
|
|
</div>
|
|
<div className="flex min-h-0 flex-1 flex-col">
|
|
{children}
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default InspectLayout
|