2026-02-16 14:15:19 +02:00
|
|
|
import React from 'react';
|
|
|
|
|
import { RiFolder3Line, RiGitBranchLine } from '@remixicon/react';
|
|
|
|
|
|
2026-03-02 02:11:33 +02:00
|
|
|
import { SortableTabsStrip } from '@/components/ui/sortable-tabs-strip';
|
2026-02-16 14:15:19 +02:00
|
|
|
import { GitView } from '@/components/views';
|
|
|
|
|
import { useUIStore } from '@/stores/useUIStore';
|
|
|
|
|
import { SidebarFilesTree } from './SidebarFilesTree';
|
|
|
|
|
|
|
|
|
|
type RightTab = 'git' | 'files';
|
|
|
|
|
|
|
|
|
|
export const RightSidebarTabs: React.FC = () => {
|
|
|
|
|
const rightSidebarTab = useUIStore((state) => state.rightSidebarTab);
|
|
|
|
|
const setRightSidebarTab = useUIStore((state) => state.setRightSidebarTab);
|
|
|
|
|
|
2026-03-02 02:11:33 +02:00
|
|
|
const tabItems = React.useMemo(() => [
|
|
|
|
|
{
|
|
|
|
|
id: 'git',
|
|
|
|
|
label: 'Git',
|
|
|
|
|
icon: <RiGitBranchLine className="h-3.5 w-3.5" />,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 'files',
|
|
|
|
|
label: 'Files',
|
|
|
|
|
icon: <RiFolder3Line className="h-3.5 w-3.5" />,
|
|
|
|
|
},
|
|
|
|
|
], []);
|
|
|
|
|
|
2026-02-16 14:15:19 +02:00
|
|
|
return (
|
2026-02-25 14:32:23 +02:00
|
|
|
<div className="flex h-full min-h-0 flex-col overflow-hidden bg-transparent">
|
2026-03-02 02:11:33 +02:00
|
|
|
<div className="h-9 bg-transparent pt-1 px-2">
|
|
|
|
|
<SortableTabsStrip
|
|
|
|
|
items={tabItems}
|
|
|
|
|
activeId={rightSidebarTab}
|
|
|
|
|
onSelect={(tabID) => setRightSidebarTab(tabID as RightTab)}
|
|
|
|
|
layoutMode="fit"
|
|
|
|
|
variant="active-pill"
|
|
|
|
|
className="h-full"
|
2026-02-16 14:15:19 +02:00
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="min-h-0 flex-1 overflow-hidden">
|
2026-03-03 00:20:15 +02:00
|
|
|
{rightSidebarTab === 'git' ? <GitView /> : <SidebarFilesTree />}
|
2026-02-16 14:15:19 +02:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|