@@ -2,7 +2,8 @@ import type { FC } from "hono/jsx";
22import BaseTemplate , { type BaseTemplateProps } from "./BaseTemplate" ;
33import type { TypeBody , Page } from "../../types/model" ;
44import { Tooltip , FunctionDisplay } from "../ui" ;
5- import { type2class } from "../ui/type2class" ;
5+ import { TypeIcon } from "../ui/TypeIcon" ;
6+ import { type2href } from "../ui/type2href" ;
67
78export type TypeTemplateProps = Omit < BaseTemplateProps , "page" > & {
89 page : Omit < Page , "body" > & {
@@ -28,19 +29,16 @@ export const TypeTemplate: FC<TypeTemplateProps> = ({
2829 nextPage = { nextPage }
2930 >
3031 < h1 id = "summary" >
31- < span class = { `pill ${ type2class ( content . name ) } ` } > { content . name } </ span >
32+ < TypeIcon type = { content . name } isHeading = { true } / >
3233 </ h1 >
3334
3435 < div dangerouslySetInnerHTML = { { __html : content . details } } />
3536
3637 { content . constructor && (
3738 < >
38- < h2 id = "constructor" >
39- < Tooltip
40- name = "コンストラクタ"
41- desc = "If a type has a constructor, you can call it like a function to create a new value of the type."
42- prefix = "constructor"
43- />
39+ < h2 id = "constructor" class = "flex items-center gap-1" >
40+ コンストラクタ
41+ < Tooltip kind = "parameters" />
4442 </ h2 >
4543
4644 < FunctionDisplay
@@ -53,32 +51,22 @@ export const TypeTemplate: FC<TypeTemplateProps> = ({
5351
5452 { content . scope . length > 0 && (
5553 < >
56- < h2 id = "definitions" >
57- < Tooltip
58- name = "定義"
59- desc = "Functions and types and can have associated definitions. These are accessed by specifying the function or type, followed by a period, and then the definition's name."
60- prefix = "definitions"
61- />
54+ < h2 id = "definitions" class = "flex items-center gap-1" >
55+ 定義
56+ < Tooltip kind = "definitions" />
6257 </ h2 >
6358
6459 { content . scope . map ( ( method , index ) => (
6560 < div >
66- < h3 id = { `definitions-${ method . name } ` } class = "method-head" >
67- < code > { method . name } </ code >
68- < small >
69- { method . element && (
70- < Tooltip
71- name = "Element"
72- desc = "Element functions can be customized with <code>set</code> and <code>show</code> rules."
73- />
74- ) }
75- { method . contextual && (
76- < Tooltip
77- name = "Contextual"
78- desc = "Contextual functions can only be used when the context is known"
79- />
80- ) }
81- </ small >
61+ < h3
62+ id = { `definitions-${ method . name } ` }
63+ class = "method-head flex items-center gap-2 mb-3"
64+ >
65+ < code class = "text-base font-medium" > { method . name } </ code >
66+ < div class = "flex flex-wrap items-center gap-2" >
67+ { method . element && < Tooltip kind = "element" /> }
68+ { method . contextual && < Tooltip kind = "contextual" /> }
69+ </ div >
8270 </ h3 >
8371
8472 < FunctionDisplay
0 commit comments