11import type { FC } from "hono/jsx" ;
22import { basePath } from "../../metadata" ;
33import { Translation } from "../../translation/" ;
4- import type { Func } from "../../types/model" ;
4+ import type { Param } from "../../types/model" ;
55import { normalizeDetailBlocks } from "../../utils/normalizeModel" ;
66import { joinPath } from "../../utils/path" ;
77import { ChevronRightIcon } from "../icons" ;
@@ -11,7 +11,9 @@ import { TypeIcon } from "./TypeIcon";
1111import { buildParamId , type2href } from "./type2href" ;
1212
1313type FunctionParametersProps = {
14- func : Func ;
14+ params : Param [ ] ;
15+ /** Whether these parameter are global attributes */
16+ globalAttributes ?: boolean ;
1517 /**
1618 * The prefix for IDs
1719 *
@@ -21,17 +23,19 @@ type FunctionParametersProps = {
2123} ;
2224
2325export const FunctionParameters : FC < FunctionParametersProps > = ( {
24- func,
26+ params,
27+ globalAttributes = false ,
2528 prefix = undefined ,
2629} ) => {
30+ const Heading = globalAttributes ? "h3" : "h4" ;
2731 return (
2832 < div class = "space-y-6" >
29- { func . params . map ( ( param , _index ) => (
33+ { params . map ( ( param , _index ) => (
3034 < div
3135 key = { param . name }
3236 class = "bg-gray-50 rounded-md p-4 border border-gray-100"
3337 >
34- < h4
38+ < Heading
3539 id = { buildParamId ( param . name , prefix ) }
3640 class = "flex flex-wrap items-center gap-2 mb-3"
3741 >
@@ -57,7 +61,7 @@ export const FunctionParameters: FC<FunctionParametersProps> = ({
5761 { param . variadic && < Tooltip kind = "variadic" /> }
5862 { param . settable && < Tooltip kind = "settable" /> }
5963 </ div >
60- </ h4 >
64+ </ Heading >
6165
6266 { normalizeDetailBlocks ( param ) . map ( ( block ) => {
6367 switch ( block . kind ) {
0 commit comments