From e33b81775e92d51c3d1002e92ef7be88c4c8ad26 Mon Sep 17 00:00:00 2001 From: Clas Wen Date: Fri, 3 Oct 2025 23:28:49 +0800 Subject: [PATCH] change loading --- src/pages/repair/RepairLandingSection.tsx | 64 ++++------------------- src/pages/repair/index.astro | 3 +- 2 files changed, 12 insertions(+), 55 deletions(-) diff --git a/src/pages/repair/RepairLandingSection.tsx b/src/pages/repair/RepairLandingSection.tsx index 513f0ed..39f3028 100644 --- a/src/pages/repair/RepairLandingSection.tsx +++ b/src/pages/repair/RepairLandingSection.tsx @@ -1,5 +1,5 @@ import { useState, useEffect } from "react" -import { Button, Card, CardBody, CardFooter } from "@heroui/react" +import { Button } from "@heroui/react" import { makeLogtoClient } from "../../utils/auth" import { saturdayClient } from "../../utils/client" import RepairHistoryCard from "./RepairHistoryCard" @@ -75,31 +75,6 @@ export default function RepairLandingSection() { window.location.href = createRepairPath } - const handleEdit = (event: PublicEvent) => { - setSelectedEvent(event) - setIsEditOpen(true) - } - - const handleCancel = async (event: PublicEvent) => { - try { - const logtoToken = await makeLogtoClient().getAccessToken() - await saturdayClient.DELETE("/client/events/{EventId}", { - params: { - path: { - EventId: event.eventId, - }, - }, - headers: { - Authorization: `Bearer ${logtoToken}`, - }, - }) - await fetchRecentEvents() - } - catch (error) { - console.error("Error cancelling event:", error) - } - } - const handleViewDetail = (event: PublicEvent) => { window.location.href = `/repair/ticket-detail?eventId=${event.eventId}` } @@ -142,7 +117,7 @@ export default function RepairLandingSection() { {/* Recent events section - only for authenticated users */} - {userInfo && ( + {userInfo && recentEvents.length > 0 && (

最近的维修

@@ -156,32 +131,15 @@ export default function RepairLandingSection() {
- {recentEvents.length > 0 - ? ( -
- {recentEvents.map(event => ( - - ))} -
- ) - : ( - - -

暂无进行中的维修预约

-
- - - -
- )} +
+ {recentEvents.map(event => ( + + ))} +
)} diff --git a/src/pages/repair/index.astro b/src/pages/repair/index.astro index 4839dbf..d3b9d61 100644 --- a/src/pages/repair/index.astro +++ b/src/pages/repair/index.astro @@ -5,13 +5,12 @@ import RepairHeader from "../../components/header/RepairHeader.astro" import RepairLandingSection from "./RepairLandingSection.tsx" --- -
- +