import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useState } from 'react';
import { Button } from '../../ui/button.js';
import { FeatureFlagsProvider } from '../../../hooks/feature-flags-context.js';
import { RepositoryDrawer } from './repository-drawer.js';
const meta = {
    title: 'Drawers/Feature/RepositoryDrawer',
    component: RepositoryDrawer,
    tags: ['autodocs'],
    parameters: {
        layout: 'fullscreen',
    },
};
export default meta;
const repoData = {
    id: 'repo-1',
    name: 'shep-ai/shep',
    repositoryPath: '/home/user/shep-ai/shep',
};
function DrawerTrigger({ data, label }) {
    const [selected, setSelected] = useState(null);
    return (_jsxs("div", { className: "flex h-screen items-start p-4", children: [_jsx(Button, { variant: "outline", onClick: () => setSelected(data), children: label }), _jsx(RepositoryDrawer, { data: selected, onClose: () => setSelected(null) })] }));
}
export const Default = {
    render: () => _jsx(RepositoryDrawerShellTemplate, { data: repoData }),
};
export const LongPath = {
    render: () => (_jsx(DrawerTrigger, { data: {
            ...repoData,
            repositoryPath: '/home/user/projects/company/some-very-long-path/shep-ai/shep',
        }, label: "Open Long Path" })),
};
export const WithoutPath = {
    render: () => (_jsx(DrawerTrigger, { data: { ...repoData, repositoryPath: undefined }, label: "Open Without Path" })),
};
/* ---------------------------------------------------------------------------
 * Shell template — full page context, starts open (matches ReviewDrawerShell pattern)
 * ------------------------------------------------------------------------- */
function RepositoryDrawerShellTemplate({ data }) {
    const [selected, setSelected] = useState(data);
    return (_jsxs("div", { style: { height: '100vh', background: '#f8fafc', padding: '2rem' }, children: [_jsx("button", { type: "button", onClick: () => setSelected(data), style: { padding: '8px 16px', border: '1px solid #ccc', borderRadius: '6px' }, children: "Open Drawer" }), _jsx(RepositoryDrawer, { data: selected, onClose: () => setSelected(null) })] }));
}
/** Repository drawer rendered inside a full-page context — starts open. */
export const InDrawer = {
    render: () => _jsx(RepositoryDrawerShellTemplate, { data: repoData }),
};
/* ---------------------------------------------------------------------------
 * Git operations story — wraps with FeatureFlagsProvider for full UI rendering
 * ------------------------------------------------------------------------- */
function WithGitOpsTemplate({ data }) {
    const [selected, setSelected] = useState(data);
    const allEnabledFlags = {
        envDeploy: true,
        debug: true,
        reactFileManager: true,
        projects: false,
        codeReview: false,
        collaboration: false,
        bedrockIntegration: false,
    };
    return (_jsx(FeatureFlagsProvider, { flags: allEnabledFlags, children: _jsxs("div", { style: { height: '100vh', background: '#f8fafc', padding: '2rem' }, children: [_jsx("button", { type: "button", onClick: () => setSelected(data), style: { padding: '8px 16px', border: '1px solid #ccc', borderRadius: '6px' }, children: "Open Drawer" }), _jsx(RepositoryDrawer, { data: selected, onClose: () => setSelected(null) })] }) }));
}
/** Repository drawer with git operations section visible. */
export const WithGitOperations = {
    render: () => _jsx(WithGitOpsTemplate, { data: repoData }),
};
