'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
export function AuthSection({ auth }) {
    if (auth.authType === 'none' || auth.authType === 'inherit') {
        return null;
    }
    return /*#__PURE__*/ _jsxs("section", {
        children: [
            /*#__PURE__*/ _jsx("h2", {
                className: "text-2xl font-semibold mb-4",
                children: "Authentication"
            }),
            /*#__PURE__*/ _jsxs("div", {
                className: "bg-muted/50 rounded-sm p-6",
                children: [
                    auth.authType === 'basic' && /*#__PURE__*/ _jsxs("div", {
                        className: "space-y-2",
                        children: [
                            /*#__PURE__*/ _jsx("p", {
                                className: "text-sm font-medium",
                                children: "Type: Basic Authentication"
                            }),
                            /*#__PURE__*/ _jsx("p", {
                                className: "text-sm text-muted-foreground",
                                children: "Username and password required"
                            })
                        ]
                    }),
                    auth.authType === 'bearer' && /*#__PURE__*/ _jsxs("div", {
                        className: "space-y-2",
                        children: [
                            /*#__PURE__*/ _jsx("p", {
                                className: "text-sm font-medium",
                                children: "Type: Bearer Token"
                            }),
                            /*#__PURE__*/ _jsx("p", {
                                className: "text-sm text-muted-foreground",
                                children: "Token required in Authorization header"
                            })
                        ]
                    }),
                    auth.authType === 'api-key' && /*#__PURE__*/ _jsxs("div", {
                        className: "space-y-2",
                        children: [
                            /*#__PURE__*/ _jsx("p", {
                                className: "text-sm font-medium",
                                children: "Type: API Key"
                            }),
                            /*#__PURE__*/ _jsxs("p", {
                                className: "text-sm text-muted-foreground",
                                children: [
                                    "Key: ",
                                    /*#__PURE__*/ _jsx("code", {
                                        className: "bg-background px-2 py-1 rounded",
                                        children: auth.key
                                    })
                                ]
                            }),
                            /*#__PURE__*/ _jsxs("p", {
                                className: "text-sm text-muted-foreground",
                                children: [
                                    "Location: ",
                                    auth.addTo === 'HEADERS' ? 'Header' : 'Query Parameter'
                                ]
                            })
                        ]
                    }),
                    auth.authType === 'oauth-2' && /*#__PURE__*/ _jsxs("div", {
                        className: "space-y-2",
                        children: [
                            /*#__PURE__*/ _jsx("p", {
                                className: "text-sm font-medium",
                                children: "Type: OAuth 2.0"
                            }),
                            /*#__PURE__*/ _jsxs("p", {
                                className: "text-sm text-muted-foreground",
                                children: [
                                    "Grant Type: ",
                                    auth.grantTypeInfo.grantType.replace('_', ' ')
                                ]
                            }),
                            auth.grantTypeInfo.authEndpoint && /*#__PURE__*/ _jsxs("p", {
                                className: "text-sm text-muted-foreground",
                                children: [
                                    "Auth Endpoint: ",
                                    /*#__PURE__*/ _jsx("code", {
                                        className: "bg-background px-2 py-1 rounded",
                                        children: auth.grantTypeInfo.authEndpoint
                                    })
                                ]
                            }),
                            auth.grantTypeInfo.tokenEndpoint && /*#__PURE__*/ _jsxs("p", {
                                className: "text-sm text-muted-foreground",
                                children: [
                                    "Token Endpoint: ",
                                    /*#__PURE__*/ _jsx("code", {
                                        className: "bg-background px-2 py-1 rounded",
                                        children: auth.grantTypeInfo.tokenEndpoint
                                    })
                                ]
                            })
                        ]
                    })
                ]
            })
        ]
    });
}
