Skip to content

Commit c0ae5c6

Browse files
committed
fix: runtime bugs
1 parent 26ffff2 commit c0ae5c6

File tree

2 files changed

+13
-22
lines changed

2 files changed

+13
-22
lines changed

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

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import { CardLayout } from "@/components/card-layout";
44
import { useSuspenseQuery } from "@apollo/client/react";
5-
import Image from "next/image";
65
import { DATABASE_DETAIL_QUERY } from "./query";
76

87
export function RelationCard({ id }: { id: string }) {
@@ -22,19 +21,17 @@ export function RelationCard({ id }: { id: string }) {
2221
? (
2322
<div>
2423
<div className="overflow-hidden rounded-lg border">
25-
<Image
26-
unoptimized
27-
src={database.relationFigure}
28-
alt="資料庫關係圖"
29-
className="h-auto max-h-96 w-full object-contain"
30-
onError={(e) => {
31-
e.currentTarget.style.display = "none";
32-
e.currentTarget.nextElementSibling?.classList.remove("hidden");
33-
}}
34-
/>
35-
<div className="hidden p-4 text-center text-muted-foreground">
36-
無法載入圖片
37-
</div>
24+
<picture>
25+
<img
26+
src={database.relationFigure}
27+
alt="資料庫關係圖"
28+
className="h-auto max-h-96 w-full object-contain"
29+
onError={(e) => {
30+
e.currentTarget.style.display = "none";
31+
e.currentTarget.nextElementSibling?.classList.remove("hidden");
32+
}}
33+
/>
34+
</picture>
3835
</div>
3936
</div>
4037
)

components/app-sidebar.tsx

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

33
import { Book, Code, LibrarySquare, type LucideIcon, SquareUser } from "lucide-react";
4-
import Image from "next/image";
54
import * as React from "react";
65

76
import { NavMain } from "@/components/nav-main";
@@ -20,6 +19,7 @@ import { useUser } from "@/providers/use-user";
2019
import Link from "next/link";
2120
import { usePathname } from "next/navigation";
2221
import { Suspense } from "react";
22+
import { Logo } from "./logo";
2323

2424
export interface NavItem {
2525
title: string;
@@ -127,13 +127,7 @@ export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
127127
rounded-lg text-sidebar-primary-foreground
128128
`}
129129
>
130-
<Image
131-
src="/logo.svg"
132-
unoptimized
133-
alt="Database Playground"
134-
width={16}
135-
height={16}
136-
/>
130+
<Logo />
137131
</div>
138132
<div className="grid flex-1 text-left text-sm leading-tight">
139133
<span className="truncate font-medium">資料庫練功坊</span>

0 commit comments

Comments
 (0)