Skip to content

Commit dca1d60

Browse files
committed
fix: apply copilot suggestions
1 parent 89a6000 commit dca1d60

File tree

3 files changed

+29
-8
lines changed

3 files changed

+29
-8
lines changed

website/src/components/ui/Tooltip.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
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";
33
import { 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" }}

website/src/components/ui/common/TranslationStatusAlert.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { FC, JSXNode } from "hono/jsx";
1+
import type { FC } from "hono/jsx";
22
import { twMerge } from "tailwind-merge";
33
import { Translation } from "../../../translation";
44
import type { TranslationStatus } from "../../../utils/translationStatus";

website/src/translation.tsx

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { FC } from "hono/jsx";
2+
import type { TooltipProps } from "./components/ui/Tooltip";
23
import {
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

2950
type TranslationKey =

0 commit comments

Comments
 (0)