// Adapted from jalcoui (MIT) — github.com/jal-co/ui 'use client'; import * as React from 'react'; import { cn } from '@djangocfg/ui-core/lib'; import type { ApiProp } from '../types'; import { TypeDisplay } from './TypeDisplay'; interface RowProps { prop: ApiProp; showDefault: boolean; } /** * Single parameter row. Click to expand `description` / `fullType` when * either is present; otherwise the button is rendered disabled so the * row stays keyboard-accessible but doesn't pretend to be interactive. */ export function Row({ prop, showDefault }: RowProps) { const [open, setOpen] = React.useState(false); const hasDetails = Boolean(prop.description || prop.fullType); return (
{open && hasDetails && (
{prop.description && (

{prop.description}

)} {prop.fullType && (
Type
)}
)}
); }