({
presets,
selectedPreset,
onPresetChange,
onBackToDashboard,
}: ReportHeaderProps)
| 22 | } |
| 23 | |
| 24 | const ReportHeader = ({ |
| 25 | presets, |
| 26 | selectedPreset, |
| 27 | onPresetChange, |
| 28 | onBackToDashboard, |
| 29 | }: ReportHeaderProps) => { |
| 30 | return ( |
| 31 | <> |
| 32 | <div className="bg-background/80 backdrop-blur-sm py-2 border-b px-2"> |
| 33 | <div className="flex justify-between items-center"> |
| 34 | <Button |
| 35 | variant="ghost" |
| 36 | onClick={onBackToDashboard} |
| 37 | className="text-muted-foreground hover:text-foreground w-20" |
| 38 | > |
| 39 | <ArrowLeft className="h-4 w-4 mr-1" /> |
| 40 | 返回 |
| 41 | </Button> |
| 42 | <h1 className="text-lg font-bold">GitHub 锐评报告</h1> |
| 43 | <div className="w-20"></div> |
| 44 | </div> |
| 45 | </div> |
| 46 | |
| 47 | <div className="bg-primary/5 p-6 border-b"> |
| 48 | <div className="flex justify-center mb-4"> |
| 49 | <div className="p-3 bg-primary/10 rounded-full"> |
| 50 | <Terminal className="h-8 w-8 text-primary" /> |
| 51 | </div> |
| 52 | </div> |
| 53 | <h2 className="text-center text-xl md:text-2xl mb-1 font-semibold"> |
| 54 | GitHub 锐评结果 |
| 55 | </h2> |
| 56 | <p className="text-center text-sm text-muted-foreground"> |
| 57 | 基于你的 GitHub 活动生成的命令行风格报告 |
| 58 | </p> |
| 59 | |
| 60 | {/* Preset selector */} |
| 61 | {presets.length > 0 && ( |
| 62 | <div className="mt-4 flex justify-center"> |
| 63 | <div className="flex items-center gap-2"> |
| 64 | <Select |
| 65 | value={selectedPreset} |
| 66 | onValueChange={onPresetChange} |
| 67 | > |
| 68 | <SelectTrigger className="w-[180px] bg-background/60"> |
| 69 | <SelectValue placeholder="选择报告类型" /> |
| 70 | </SelectTrigger> |
| 71 | <SelectContent> |
| 72 | <SelectGroup> |
| 73 | {presets.map((preset) => ( |
| 74 | <SelectItem key={preset.name} value={preset.name}> |
| 75 | {preset.description} |
| 76 | </SelectItem> |
| 77 | ))} |
| 78 | </SelectGroup> |
| 79 | </SelectContent> |
| 80 | </Select> |
| 81 | </div> |
nothing calls this directly
no outgoing calls
no test coverage detected