Skip to content

Commit bf3f508

Browse files
committed
style: react component prop readonly
1 parent 7b1924a commit bf3f508

File tree

12 files changed

+22
-16
lines changed

12 files changed

+22
-16
lines changed

web/src/components/code-viewer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Button, type ButtonProps } from "@/components/ui/button.tsx";
1+
import { Button, type ButtonProps } from "@/components/ui/button";
22
import { Check, Copy } from "lucide-react";
33
import { type HTMLProps, type ReactNode, useCallback, useEffect, useState } from "react";
44
import { CopyToClipboard } from "react-copy-to-clipboard";
@@ -12,7 +12,7 @@ interface CopyButtonProps extends ButtonProps {
1212
src?: string;
1313
}
1414

15-
export function CopyButton({ value }: CopyButtonProps) {
15+
export function CopyButton({ value }: Readonly<CopyButtonProps>) {
1616
const [hasCopied, setHasCopied] = useState(false);
1717
const { t } = useTranslation();
1818

web/src/components/copyable-field.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ interface CopyableFieldProps {
1212
text?: string;
1313
}
1414

15-
export function CopyableField({ label, value, text }: CopyableFieldProps) {
15+
export function CopyableField({ label, value, text }: Readonly<CopyableFieldProps>) {
1616
const [hasCopied, setHasCopied] = useState(false);
1717
const { t } = useTranslation();
1818

web/src/components/shell-result.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ export function ShellResult({
1616
allPackResults,
1717
packMethod,
1818
generateResult,
19-
}: {
19+
}: Readonly<{
2020
packResult: string | undefined;
2121
allPackResults: Map<string, string> | undefined;
2222
packMethod: string;
2323
generateResult?: GenerateResult;
24-
}) {
24+
}>) {
2525
const { t } = useTranslation();
2626
if (!generateResult) {
2727
return <QuickUsage />;

web/src/components/tools/antsword-tab.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { UrlPatternFormField } from "./urlpattern-field";
1212
export function AntSwordTabContent({
1313
form,
1414
shellTypes,
15-
}: { form: UseFormReturn<FormSchema>; shellTypes: Array<string> }) {
15+
}: Readonly<{ form: UseFormReturn<FormSchema>; shellTypes: Array<string> }>) {
1616
const { t } = useTranslation();
1717
return (
1818
<FormProvider {...form}>

web/src/components/tools/behinder-tab.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { UrlPatternFormField } from "./urlpattern-field";
1212
export function BehinderTabContent({
1313
form,
1414
shellTypes,
15-
}: { form: UseFormReturn<FormSchema>; shellTypes: Array<string> }) {
15+
}: Readonly<{ form: UseFormReturn<FormSchema>; shellTypes: Array<string> }>) {
1616
const { t } = useTranslation();
1717
return (
1818
<FormProvider {...form}>

web/src/components/tools/classname-field.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { FormSchema } from "@/types/schema.ts";
44
import { FormProvider, UseFormReturn } from "react-hook-form";
55
import { useTranslation } from "react-i18next";
66

7-
export function OptionalClassFormField({ form }: { form: UseFormReturn<FormSchema> }) {
7+
export function OptionalClassFormField({ form }: Readonly<{ form: UseFormReturn<FormSchema> }>) {
88
const { t } = useTranslation();
99
return (
1010
<FormProvider {...form}>

web/src/components/tools/command-tab.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { UrlPatternFormField } from "./urlpattern-field";
1212
export function CommandTabContent({
1313
form,
1414
shellTypes,
15-
}: { form: UseFormReturn<FormSchema>; shellTypes: Array<string> }) {
15+
}: Readonly<{ form: UseFormReturn<FormSchema>; shellTypes: Array<string> }>) {
1616
const { t } = useTranslation();
1717
return (
1818
<FormProvider {...form}>

web/src/components/tools/godzilla-tab.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { UrlPatternFormField } from "./urlpattern-field";
1212
export function GodzillaTabContent({
1313
form,
1414
shellTypes,
15-
}: { form: UseFormReturn<FormSchema>; shellTypes: Array<string> }) {
15+
}: Readonly<{ form: UseFormReturn<FormSchema>; shellTypes: Array<string> }>) {
1616
const { t } = useTranslation();
1717
return (
1818
<FormProvider {...form}>

web/src/components/tools/neoreg-tab.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ import { OptionalClassFormField } from "./classname-field";
99
import { ShellTypeFormField } from "./shelltype-field";
1010
import { UrlPatternFormField } from "./urlpattern-field";
1111

12-
export function NeoRegTabContent({ form, shellTypes }: { form: UseFormReturn<FormSchema>; shellTypes: Array<string> }) {
12+
export function NeoRegTabContent({
13+
form,
14+
shellTypes,
15+
}: Readonly<{ form: UseFormReturn<FormSchema>; shellTypes: Array<string> }>) {
1316
const { t } = useTranslation();
1417
return (
1518
<FormProvider {...form}>

web/src/components/tools/shelltype-field.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { useTranslation } from "react-i18next";
88
export function ShellTypeFormField({
99
form,
1010
shellTypes,
11-
}: { form: UseFormReturn<FormSchema>; shellTypes: Array<string> }) {
11+
}: Readonly<{ form: UseFormReturn<FormSchema>; shellTypes: Array<string> }>) {
1212
const { t } = useTranslation();
1313
return (
1414
<FormProvider {...form}>
@@ -24,8 +24,8 @@ export function ShellTypeFormField({
2424
<SelectValue placeholder={t("placeholders.select")} />
2525
</SelectTrigger>
2626
</FormControl>
27-
<SelectContent key={shellTypes.join(",")}>
28-
{shellTypes.length ? (
27+
<SelectContent key={shellTypes?.join(",")}>
28+
{shellTypes?.length ? (
2929
shellTypes.map((v) => (
3030
<SelectItem key={v} value={v}>
3131
{v}

0 commit comments

Comments
 (0)