新增分享功能
This commit is contained in:
@@ -7,7 +7,7 @@ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { Badge } from "@/components/ui/badge"
|
||||
import { Progress } from "@/components/ui/progress"
|
||||
import { CheckCircle, XCircle, Brain, Lightbulb, BarChart3, ArrowLeft, Loader2, Printer } from "lucide-react"
|
||||
import { CheckCircle, XCircle, Brain, Lightbulb, BarChart3, ArrowLeft, Loader2, Printer, Share2 } from "lucide-react"
|
||||
import Link from "next/link"
|
||||
import { CreativeAnalysis } from "@/components/creative-analysis"
|
||||
import { CombinedAnalysis } from "@/components/combined-analysis"
|
||||
@@ -344,7 +344,7 @@ function AdminResultDetailContent() {
|
||||
{/* Header */}
|
||||
<header className="border-b bg-card/50 backdrop-blur-sm">
|
||||
<div className="container mx-auto px-4 py-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
|
||||
<div className="flex items-center gap-3">
|
||||
<Button variant="ghost" size="sm" asChild>
|
||||
<Link href="/admin/results">
|
||||
@@ -364,15 +364,37 @@ function AdminResultDetailContent() {
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<Button
|
||||
onClick={() => window.print()}
|
||||
variant="outline"
|
||||
size="sm"
|
||||
className="print:hidden"
|
||||
>
|
||||
<Printer className="w-4 h-4 mr-2" />
|
||||
列印結果
|
||||
</Button>
|
||||
<div className="flex justify-end gap-2">
|
||||
<Button
|
||||
onClick={() => {
|
||||
if (navigator.share) {
|
||||
navigator.share({
|
||||
title: `${user.name} - ${testTypeInfo.name}測試結果`,
|
||||
text: `查看${user.name}的${testTypeInfo.name}測試結果`,
|
||||
url: window.location.href
|
||||
})
|
||||
} else {
|
||||
navigator.clipboard.writeText(window.location.href)
|
||||
alert('連結已複製到剪貼簿')
|
||||
}
|
||||
}}
|
||||
variant="outline"
|
||||
size="sm"
|
||||
className="print:hidden"
|
||||
>
|
||||
<Share2 className="w-4 h-4 sm:mr-2" />
|
||||
<span className="hidden sm:inline">分享結果</span>
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => window.print()}
|
||||
variant="outline"
|
||||
size="sm"
|
||||
className="print:hidden"
|
||||
>
|
||||
<Printer className="w-4 h-4 sm:mr-2" />
|
||||
<span className="hidden sm:inline">列印結果</span>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
Reference in New Issue
Block a user