File tree Expand file tree Collapse file tree 3 files changed +29
-8
lines changed Expand file tree Collapse file tree 3 files changed +29
-8
lines changed Original file line number Diff line number Diff line change 1- import type { FC , JSX , JSXNode } from "hono/jsx" ;
2- import { Translation , TranslationProps , translation } from "../../translation" ;
1+ import type { FC } from "hono/jsx" ;
2+ import { Translation , translation } from "../../translation" ;
33import { CloseIcon , HelpCircleIcon } from "../icons" ;
44
5- type TooltipProps = {
5+ export type TooltipProps = {
66 kind :
77 | "element"
88 | "contextual"
@@ -102,7 +102,7 @@ export const Tooltip: FC<TooltipProps> = ({ kind }) => {
102102 type = "button"
103103 class = "w-4 h-4 hover:bg-black/10 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 cursor-pointer"
104104 aria-label = { translation . showInformation ( {
105- name : String ( content . label ) ,
105+ name : translation . tooltipKind ( { kind } ) ,
106106 } ) }
107107 tabindex = { 0 }
108108 { ...{ "x-on:click" : "helpOpen = true" } }
Original file line number Diff line number Diff line change 1- import type { FC , JSXNode } from "hono/jsx" ;
1+ import type { FC } from "hono/jsx" ;
22import { twMerge } from "tailwind-merge" ;
33import { Translation } from "../../../translation" ;
44import type { TranslationStatus } from "../../../utils/translationStatus" ;
Original file line number Diff line number Diff line change 11import type { FC } from "hono/jsx" ;
2+ import type { TooltipProps } from "./components/ui/Tooltip" ;
23import {
34 discordServerUrl ,
45 githubOrganizationUrl ,
@@ -21,9 +22,29 @@ export const translation = {
2122 closeSearch : ( ) => "検索を閉じる" ,
2223 openMenu : ( ) => "メニューを開く" ,
2324 openSearch : ( ) => "検索を開く" ,
24- showInformation : ( props : {
25- name : string ;
26- } ) => `${ props . name } の詳細情報を表示` ,
25+ showInformation : ( props : { name : string } ) => `${ props . name } の詳細情報を表示` ,
26+ tooltipKind : ( props : { kind : TooltipProps [ "kind" ] } ) => {
27+ switch ( props . kind ) {
28+ case "element" :
29+ return "要素関数" ;
30+ case "contextual" :
31+ return "コンテキスト関数" ;
32+ case "definitions" :
33+ return "定義" ;
34+ case "parameters" :
35+ return "引数" ;
36+ case "variadic" :
37+ return "可変長引数" ;
38+ case "settable" :
39+ return "設定可能引数" ;
40+ case "positional" :
41+ return "位置引数" ;
42+ case "required" :
43+ return "必須引数" ;
44+ default :
45+ return props . kind ;
46+ }
47+ } ,
2748} as const ;
2849
2950type TranslationKey =
You can’t perform that action at this time.
0 commit comments