Skip to content

Commit bf39564

Browse files
committed
refactor: adjust code formatting in UI components and update fetchProviders hook dependencies
1 parent 81de25d commit bf39564

File tree

3 files changed

+35
-17
lines changed

3 files changed

+35
-17
lines changed

src/components/console/SeparatorRow.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ export function SeparatorRow({ label }: SeparatorRowProps) {
88
return (
99
<HStack align="center" my={0.5} px={{ base: 0.5, md: 1 }} color="fg.muted">
1010
<Box flex="1" borderTopWidth="1px" borderColor="border" />
11-
<Text fontSize="xs" px={{ base: 1, md: 2 }} whiteSpace="nowrap">{label}</Text>
11+
<Text fontSize="xs" px={{ base: 1, md: 2 }} whiteSpace="nowrap">
12+
{label}
13+
</Text>
1214
<Box flex="1" borderTopWidth="1px" borderColor="border" />
1315
</HStack>
1416
);
1517
}
16-

src/pages/settings/ProvidersPage.tsx

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,12 @@ export function ProvidersPage() {
5454
const [isCreating, setIsCreating] = React.useState(false);
5555

5656
// バリデーションスキーマ
57-
const providerFormSchema = React.useMemo(() => z.object({
58-
displayName: z.string().min(1, t("providers.displayNameRequired")),
59-
apiKey: z.string().min(1, t("providers.apiKeyRequired")),
60-
apiEndpoint: z.string().url(t("providers.apiEndpointInvalid")),
61-
}), [t]);
57+
const providerFormSchema = React.useMemo(() =>
58+
z.object({
59+
displayName: z.string().min(1, t("providers.displayNameRequired")),
60+
apiKey: z.string().min(1, t("providers.apiKeyRequired")),
61+
apiEndpoint: z.string().url(t("providers.apiEndpointInvalid")),
62+
}), [t]);
6263

6364
const {
6465
register,
@@ -97,7 +98,7 @@ export function ProvidersPage() {
9798
} finally {
9899
setLoading(false);
99100
}
100-
}, []);
101+
}, [t]);
101102

102103
React.useEffect(() => {
103104
fetchProviders();
@@ -318,7 +319,9 @@ export function ProvidersPage() {
318319
<EmptyState
319320
icon={<LuServer />}
320321
title={t("providers.emptyTitle")}
321-
description={t("providers.emptyDescription")}
322+
description={t(
323+
"providers.emptyDescription",
324+
)}
322325
action={{
323326
label: t("providers.emptyAction"),
324327
onClick: startCreate,
@@ -399,7 +402,9 @@ export function ProvidersPage() {
399402
? (
400403
<>
401404
<IconButton
402-
aria-label={t("providers.save")}
405+
aria-label={t(
406+
"providers.save",
407+
)}
403408
size="sm"
404409
colorPalette="green"
405410
onClick={handleSubmitEdit(
@@ -416,7 +421,9 @@ export function ProvidersPage() {
416421
<LuCheck />
417422
</IconButton>
418423
<IconButton
419-
aria-label={t("providers.cancel")}
424+
aria-label={t(
425+
"providers.cancel",
426+
)}
420427
size="sm"
421428
variant="ghost"
422429
onClick={() => {
@@ -433,7 +440,9 @@ export function ProvidersPage() {
433440
: (
434441
<>
435442
<IconButton
436-
aria-label={t("providers.edit")}
443+
aria-label={t(
444+
"providers.edit",
445+
)}
437446
size="sm"
438447
variant="ghost"
439448
onClick={() =>
@@ -444,7 +453,9 @@ export function ProvidersPage() {
444453
<LuPencil />
445454
</IconButton>
446455
<IconButton
447-
aria-label={t("providers.delete")}
456+
aria-label={t(
457+
"providers.delete",
458+
)}
448459
size="sm"
449460
variant="ghost"
450461
colorPalette="red"

src/pages/workflows/useWorkflowRun.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
import React from "react";
88
import { clients } from "@/lib/grpc-clients";
99
import type { RunWorkflowResponse } from "@/gen/sapphillon/v1/workflow_service_pb";
10-
import { WorkflowSourceByIdSchema } from "@/gen/sapphillon/v1/workflow_service_pb";
10+
import {
11+
WorkflowSourceByIdSchema,
12+
type WorkflowSourceById,
13+
} from "@/gen/sapphillon/v1/workflow_service_pb";
1114
import type { Workflow } from "@/gen/sapphillon/v1/workflow_pb";
1215
import { create } from "@bufbuild/protobuf";
1316

@@ -69,7 +72,7 @@ export function useWorkflowRun(): UseWorkflowRunReturn {
6972
byId: create(WorkflowSourceByIdSchema, {
7073
workflowId,
7174
workflowCodeId: workflowCodeId || "",
72-
}),
75+
}) as WorkflowSourceById,
7376
});
7477
setRunRes(res);
7578
append({ kind: "message", payload: res });
@@ -95,7 +98,10 @@ export function useWorkflowRun(): UseWorkflowRunReturn {
9598
setRunRes(null);
9699
setRunning(true);
97100
try {
98-
append({ kind: "message", payload: { stage: "save", status: "start" } });
101+
append({
102+
kind: "message",
103+
payload: { stage: "save", status: "start" },
104+
});
99105

100106
// ワークフローを保存
101107
const saveResponse = await clients.workflow.updateWorkflow({
@@ -122,7 +128,7 @@ export function useWorkflowRun(): UseWorkflowRunReturn {
122128
byId: create(WorkflowSourceByIdSchema, {
123129
workflowId,
124130
workflowCodeId,
125-
}),
131+
}) as WorkflowSourceById,
126132
});
127133

128134
setRunRes(res);

0 commit comments

Comments
 (0)