- Implemented TemplateCheckpointEditDialog for creating and editing inspection checkpoints. - Added VendorActions component for managing vendor actions including edit, activate/deactivate, and delete. - Created VendorContext for managing vendor state across components. - Developed VendorGeneralInfo component to display detailed vendor information. - Introduced AedSymbol and Money components for consistent currency representation. - Added PromptDialog for user input prompts throughout the application. - Implemented RelationLink component for unified related-data display in CRUD tables. - Created InspectionTemplatesClient for API interactions related to inspection templates.
44 lines
1.7 KiB
TypeScript
44 lines
1.7 KiB
TypeScript
"use client"
|
|
|
|
import { useState } from "react"
|
|
import Link from "next/link"
|
|
import { ClipboardList, Printer, Share2 } from "lucide-react"
|
|
import { Button } from "@/shared/components/ui/button"
|
|
import { InspectionShareDialog } from "@/modules/inspections/inspection-share-dialog"
|
|
|
|
/**
|
|
* Client island for the inspection detail page header — exposes the Share
|
|
* dialog and a quick link to the technician's checkpoints page without
|
|
* pulling the entire page out of the server-component tree.
|
|
*/
|
|
export function InspectionDetailHeader({
|
|
inspectionId,
|
|
title,
|
|
}: {
|
|
inspectionId: number | string
|
|
title?: string
|
|
}) {
|
|
const [shareOpen, setShareOpen] = useState(false)
|
|
|
|
return (
|
|
<div className="flex items-center justify-between flex-wrap gap-2 mb-3">
|
|
<div className="min-w-0">
|
|
<div className="text-xs text-muted-foreground uppercase tracking-wide">Inspection</div>
|
|
<h1 className="text-xl sm:text-2xl font-bold truncate">{title ?? "Inspection"}</h1>
|
|
</div>
|
|
<div className="flex items-center gap-2">
|
|
<Button variant="outline" size="sm" asChild>
|
|
<Link href={`/sales/inspections/${inspectionId}/checkpoints`}>
|
|
<ClipboardList className="size-4" /> Checkpoints
|
|
</Link>
|
|
</Button>
|
|
<Button variant="default" size="sm" onClick={() => setShareOpen(true)}>
|
|
<Share2 className="size-4" /> Share with customer
|
|
</Button>
|
|
</div>
|
|
|
|
<InspectionShareDialog open={shareOpen} onOpenChange={setShareOpen} inspectionId={inspectionId} />
|
|
</div>
|
|
)
|
|
}
|