Skip to content

Commit d9d8f82

Browse files
committed
style: fmt code
1 parent fbca588 commit d9d8f82

150 files changed

Lines changed: 946 additions & 1520 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

web/app/components/code-viewer.tsx

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
import type { VariantProps } from "class-variance-authority";
2+
23
import { Check, Copy } from "lucide-react";
3-
import {
4-
type HTMLProps,
5-
type ReactNode,
6-
useCallback,
7-
useEffect,
8-
useState,
9-
} from "react";
4+
import { type HTMLProps, type ReactNode, useCallback, useEffect, useState } from "react";
105
import CopyToClipboard from "react-copy-to-clipboard";
116
import { useTranslation } from "react-i18next";
127
import { PrismLight as SyntaxHighlighter } from "react-syntax-highlighter";
138
import java from "react-syntax-highlighter/dist/esm/languages/prism/java";
149
import materialDark from "react-syntax-highlighter/dist/esm/styles/prism/material-dark";
1510
import { toast } from "sonner";
11+
1612
import { Button, type buttonVariants } from "@/components/ui/button";
1713
import { cn } from "@/lib/utils";
1814

@@ -68,25 +64,21 @@ export default function CodeViewer({
6864
showLineNumbers = true,
6965
wrapLongLines = true,
7066
}: Readonly<CodeViewerProps>) {
71-
const lineProps: lineTagPropsFunction | HTMLProps<HTMLElement> | undefined =
72-
wrapLongLines
73-
? { style: { overflowWrap: "break-word", whiteSpace: "pre-wrap" } }
74-
: undefined;
67+
const lineProps: lineTagPropsFunction | HTMLProps<HTMLElement> | undefined = wrapLongLines
68+
? { style: { overflowWrap: "break-word", whiteSpace: "pre-wrap" } }
69+
: undefined;
7570
return (
7671
<div className="rounded-lg border">
7772
<div
78-
className={cn(
79-
"flex items-center border-b p-2 justify-end",
80-
header && "justify-between",
81-
)}
73+
className={cn("flex items-center justify-end border-b p-2", header && "justify-between")}
8274
>
8375
{header}
8476
<div className="flex items-center gap-2">
8577
{button}
8678
<CopyButton value={code} variant="ghost" size="sm" />
8779
</div>
8880
</div>
89-
<div className="relative overflow-hidden text-xs wrap-all">
81+
<div className="wrap-all relative overflow-hidden text-xs">
9082
<SyntaxHighlighter
9183
language={language}
9284
style={materialDark}

web/app/components/copyable-field.tsx

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
import { Check, Copy } from "lucide-react";
2-
import {
3-
type ComponentPropsWithoutRef,
4-
useCallback,
5-
useEffect,
6-
useState,
7-
} from "react";
2+
import { type ComponentPropsWithoutRef, useCallback, useEffect, useState } from "react";
83
import CopyToClipboard from "react-copy-to-clipboard";
94
import { useTranslation } from "react-i18next";
105
import { toast } from "sonner";
6+
117
import { Button } from "@/components/ui/button";
128
import { Label } from "@/components/ui/label";
139
import { cn } from "@/lib/utils";
@@ -48,7 +44,7 @@ export function CopyableField({
4844

4945
return (
5046
<div className={cn("flex flex-col gap-1 py-1", className)} {...divProps}>
51-
<div className="flex items-center justify-between gap-2 h-6">
47+
<div className="flex h-6 items-center justify-between gap-2">
5248
<Label className="text-sm text-muted-foreground">{label}</Label>
5349
{value && (
5450
<CopyToClipboard.CopyToClipboard text={value} onCopy={handleCopy}>
@@ -59,11 +55,7 @@ export function CopyableField({
5955
className="h-8 w-8"
6056
disabled={hasCopied}
6157
>
62-
{hasCopied ? (
63-
<Check className="h-4 w-4" />
64-
) : (
65-
<Copy className="h-4 w-4" />
66-
)}
58+
{hasCopied ? <Check className="h-4 w-4" /> : <Copy className="h-4 w-4" />}
6759
</Button>
6860
</CopyToClipboard.CopyToClipboard>
6961
)}

web/app/components/image-zoom.tsx

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
"use client";
22

3-
import { Image, type ImageProps } from "fumadocs-core/framework";
43
import type { ComponentProps } from "react";
4+
5+
import { Image, type ImageProps } from "fumadocs-core/framework";
56
import Zoom, { type UncontrolledProps } from "react-medium-image-zoom";
7+
68
import "@/components/image-zoom.css";
79

810
export type ImageZoomProps = ImageProps & {
@@ -22,20 +24,14 @@ function getImageSrc(src: ImageProps["src"]): string {
2224

2325
if (typeof src === "object") {
2426
// Next.js
25-
if ("default" in src)
26-
return (src as { default: { src: string } }).default.src;
27+
if ("default" in src) return (src as { default: { src: string } }).default.src;
2728
return src.src;
2829
}
2930

3031
return "";
3132
}
3233

33-
export function ImageZoom({
34-
zoomInProps,
35-
children,
36-
rmiz,
37-
...props
38-
}: ImageZoomProps) {
34+
export function ImageZoom({ zoomInProps, children, rmiz, ...props }: ImageZoomProps) {
3935
return (
4036
<Zoom
4137
zoomMargin={20}
@@ -48,10 +44,7 @@ export function ImageZoom({
4844
}}
4945
>
5046
{children ?? (
51-
<Image
52-
sizes="(max-width: 768px) 100vw, (max-width: 1200px) 70vw, 900px"
53-
{...props}
54-
/>
47+
<Image sizes="(max-width: 768px) 100vw, (max-width: 1200px) 70vw, 900px" {...props} />
5548
)}
5649
</Zoom>
5750
);

web/app/components/language-switcher.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { LanguagesIcon } from "lucide-react";
22
import { useTranslation } from "react-i18next";
3+
34
import { Button } from "./ui/button";
45

56
export function LanguageSwitcher() {

web/app/components/magicui/line-shadow-text.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { type MotionProps, motion } from "motion/react";
2+
23
import { cn } from "@/lib/utils";
34

45
interface LineShadowTextProps
5-
extends Omit<React.HTMLAttributes<HTMLElement>, keyof MotionProps>,
6-
MotionProps {
6+
extends Omit<React.HTMLAttributes<HTMLElement>, keyof MotionProps>, MotionProps {
77
shadowColor?: string;
88
as?: React.ElementType;
99
}
@@ -27,7 +27,7 @@ export function LineShadowText({
2727
style={{ "--shadow-color": shadowColor } as React.CSSProperties}
2828
className={cn(
2929
"relative z-0 inline-flex",
30-
"after:absolute after:left-[0.04em] after:top-[0.04em] after:content-[attr(data-text)]",
30+
"after:absolute after:top-[0.04em] after:left-[0.04em] after:content-[attr(data-text)]",
3131
"after:bg-[linear-gradient(45deg,transparent_45%,var(--shadow-color)_45%,var(--shadow-color)_55%,transparent_0)]",
3232
"after:-z-10 after:bg-[length:0.06em_0.06em] after:bg-clip-text after:text-transparent",
3333
"after:animate-line-shadow",

web/app/components/mdx.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import defaultMdxComponents from "fumadocs-ui/mdx";
21
import type { MDXComponents } from "mdx/types";
32

3+
import defaultMdxComponents from "fumadocs-ui/mdx";
4+
45
export function getMDXComponents(components?: MDXComponents) {
56
return {
67
...defaultMdxComponents,

web/app/components/memshell/jreversion-field.tsx

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
1+
import type { MemShellFormSchema } from "@/types/schema";
2+
13
import { Controller, type UseFormReturn } from "react-hook-form";
24
import { useTranslation } from "react-i18next";
3-
import {
4-
Field,
5-
FieldContent,
6-
FieldError,
7-
FieldLabel,
8-
} from "@/components/ui/field";
5+
6+
import { Field, FieldContent, FieldError, FieldLabel } from "@/components/ui/field";
97
import {
108
Select,
119
SelectContent,
1210
SelectItem,
1311
SelectTrigger,
1412
SelectValue,
1513
} from "@/components/ui/select";
16-
import type { MemShellFormSchema } from "@/types/schema";
1714

1815
const JDKVersion = [
1916
{ name: "Java6", value: "50" },
@@ -37,9 +34,7 @@ export function JREVersionFormField({
3734
render={({ field, fieldState }) => (
3835
<Field orientation="vertical" data-invalid={fieldState.invalid}>
3936
<FieldContent>
40-
<FieldLabel htmlFor="targetJdkVersion">
41-
{t("common:targetJdkVersion")}
42-
</FieldLabel>
37+
<FieldLabel htmlFor="targetJdkVersion">{t("common:targetJdkVersion")}</FieldLabel>
4338
<Select
4439
onValueChange={(v) => {
4540
if (Number.parseInt(v ?? "0", 10) >= 53) {
@@ -51,13 +46,8 @@ export function JREVersionFormField({
5146
}}
5247
value={field.value}
5348
>
54-
<SelectTrigger
55-
id="targetJdkVersion"
56-
aria-invalid={fieldState.invalid}
57-
>
58-
<SelectValue
59-
data-placeholder={t("common:placeholders.select")}
60-
/>
49+
<SelectTrigger id="targetJdkVersion" aria-invalid={fieldState.invalid}>
50+
<SelectValue data-placeholder={t("common:placeholders.select")} />
6151
</SelectTrigger>
6252
<SelectContent>
6353
{JDKVersion.map((v) => (

0 commit comments

Comments
 (0)