Skip to content

Commit 9f7112c

Browse files
committed
style: reformat codebase
1 parent 9fcca55 commit 9f7112c

File tree

6 files changed

+32
-22
lines changed

6 files changed

+32
-22
lines changed

app/(admin)/(question-management)/database/[id]/_components/description-card.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,18 @@
22

33
import { CardLayout } from "@/components/card-layout";
44
import { useSuspenseQuery } from "@apollo/client/react";
5-
import { DATABASE_DETAIL_QUERY } from "./query";
65
import { Remark } from "react-remark";
6+
import { DATABASE_DETAIL_QUERY } from "./query";
77

88
export function DescriptionCard({ id }: { id: string }) {
99
return (
1010
<CardLayout title="資料表描述" description="這個資料表的簡單介紹。">
11-
<article className="prose dark:prose-invert">
11+
<article
12+
className={`
13+
prose
14+
dark:prose-invert
15+
`}
16+
>
1217
<Description id={id} />
1318
</article>
1419
</CardLayout>

app/(admin)/(question-management)/database/[id]/_components/relation-card.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ function RelationFigure({ id }: { id: string }) {
2020
const database = data.database;
2121

2222
// Check if the relation figure looks like a URL (basic check)
23-
const isUrl =
24-
database.relationFigure.startsWith("http://") ||
25-
database.relationFigure.startsWith("https://");
23+
const isUrl = database.relationFigure.startsWith("http://")
24+
|| database.relationFigure.startsWith("https://");
2625

2726
if (isUrl) {
2827
return (
@@ -31,7 +30,7 @@ function RelationFigure({ id }: { id: string }) {
3130
<img
3231
src={database.relationFigure}
3332
alt="資料庫關係圖"
34-
className="h-auto max-h-80 w-full object-contain rounded"
33+
className="h-auto max-h-80 w-full rounded object-contain"
3534
/>
3635
</picture>
3736
</a>
@@ -42,8 +41,8 @@ function RelationFigure({ id }: { id: string }) {
4241
<div>
4342
<pre
4443
className={`
45-
max-h-80 overflow-x-auto rounded-lg border bg-muted p-4
46-
font-mono text-sm whitespace-pre-wrap
44+
max-h-80 overflow-x-auto rounded-lg border bg-muted p-4 font-mono
45+
text-sm whitespace-pre-wrap
4746
`}
4847
>
4948
{database.relationFigure}

app/(admin)/(question-management)/database/[id]/_components/schema-card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ function Schema({ id }: { id: string }) {
3838
>
3939
{database.schema}
4040
</pre>
41-
)
41+
);
4242
}

app/(admin)/(question-management)/database/[id]/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { SiteHeader } from "@/components/site-header";
2+
import { Suspense } from "react";
23
import { DeleteDatabaseButtonTrigger } from "../_components/delete";
34
import { UpdateDatabaseButtonTrigger } from "../_components/update";
5+
import { DescriptionCard } from "./_components/description-card";
46
import { Header } from "./_components/header";
57
import { RelationCard } from "./_components/relation-card";
68
import { SchemaCard } from "./_components/schema-card";
7-
import { DescriptionCard } from "./_components/description-card";
8-
import { Suspense } from "react";
99

1010
export default async function DatabasePage({
1111
params,

app/(admin)/(question-management)/questions/[id]/_components/description-card.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
import { CardLayout } from "@/components/card-layout";
44
import { useSuspenseQuery } from "@apollo/client/react";
5-
import { QUESTION_DETAIL_QUERY } from "./query";
65
import { Remark } from "react-remark";
6+
import { QUESTION_DETAIL_QUERY } from "./query";
77

88
export function DescriptionCard({ id }: { id: string }) {
99
const { data } = useSuspenseQuery(QUESTION_DETAIL_QUERY, {
@@ -14,12 +14,15 @@ export function DescriptionCard({ id }: { id: string }) {
1414

1515
return (
1616
<CardLayout title="題幹描述" description="這道題目的詳細說明。">
17-
<article className="prose dark:prose-invert">
18-
{!question.description ? (
19-
<p className="text-muted-foreground">無描述</p>
20-
) : (
21-
<Remark>{question.description}</Remark>
22-
)}
17+
<article
18+
className={`
19+
prose
20+
dark:prose-invert
21+
`}
22+
>
23+
{!question.description
24+
? <p className="text-muted-foreground">無描述</p>
25+
: <Remark>{question.description}</Remark>}
2326
</article>
2427
</CardLayout>
2528
);

app/(admin)/(question-management)/questions/[id]/_components/result.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ export function ReferenceAnswerResult({ id }: { id: string }) {
1212

1313
return (
1414
<div className="space-y-4">
15-
<details className="group overflow-hidden rounded-lg border border-border" onToggle={(e) => {
16-
setIsOpen(e.currentTarget.open);
17-
}}>
15+
<details
16+
className="group overflow-hidden rounded-lg border border-border"
17+
onToggle={(e) => {
18+
setIsOpen(e.currentTarget.open);
19+
}}
20+
>
1821
<summary
1922
className={`
2023
flex cursor-pointer items-center justify-between bg-muted/50 px-4
@@ -38,7 +41,7 @@ export function ReferenceAnswerResult({ id }: { id: string }) {
3841
);
3942
}
4043

41-
function ReferenceAnswerResultContent({ id, open }: { id: string, open: boolean }) {
44+
function ReferenceAnswerResultContent({ id, open }: { id: string; open: boolean }) {
4245
const { data, loading, error } = useQuery(QUESTION_REFERENCE_ANSWER_RESULT_QUERY, {
4346
variables: { id },
4447
skip: !open,

0 commit comments

Comments
 (0)