Spaces:
Sleeping
Sleeping
Download src/components/ReportCard.jsx from tryprogram/offer-puplayer: direct link, hf CLI and curl.
- Browser
- Download file 4.92 kB
-
https://huggingface.co/spaces/tryprogram/offer-puplayer/resolve/main/src/components/ReportCard.jsx
- Command line
-
hf download hf://spaces/tryprogram/offer-puplayer/src/components/ReportCard.jsx
-
curl -L -o ReportCard.jsx https://huggingface.co/spaces/tryprogram/offer-puplayer/resolve/main/src/components/ReportCard.jsx
4.92 kB
| function ReportCard({ dimension, score, evidence = [], viewType, footnote, dataUnavailable, hrView }) { | |
| if (viewType === 'hr' && hrView && hrView.first_impression) { | |
| const concernLevel = hrView.hr_concern_level | |
| const levelColor = concernLevel === 'low' ? 'var(--color-success)' : concernLevel === 'medium' ? 'var(--color-warning)' : 'var(--color-error)' | |
| const levelLabel = concernLevel === 'low' ? '低' : concernLevel === 'medium' ? '中' : '高' | |
| return ( | |
| <div className="card"> | |
| <h4 className="font-bold mb-12">{dimension}</h4> | |
| <div className="hr-quote-box mb-16"> | |
| <p className="text-sm italic">"{hrView.first_impression}"</p> | |
| </div> | |
| <div className="flex flex-col gap-12 mb-16"> | |
| {hrView.attention_points && hrView.attention_points.map((point, i) => ( | |
| <div key={i} className="attention-point-box"> | |
| <p className="font-bold text-sm">{point.aspect}</p> | |
| <p className="text-sm text-secondary mt-4" style={{ wordBreak: 'break-word' }}>{point.finding}</p> | |
| {point.concern && point.concern !== '无' && ( | |
| <p className="text-sm text-error mt-4" style={{ wordBreak: 'break-word' }}>关注点: {point.concern}</p> | |
| )} | |
| </div> | |
| ))} | |
| </div> | |
| <div className="flex items-center gap-8 mb-16"> | |
| <span className="text-sm text-secondary">HR 关注度:</span> | |
| <span className="hr-concern-tag" style={{ color: levelColor, backgroundColor: `color-mix(in srgb, ${levelColor} 15%, transparent)`, border: `1px solid color-mix(in srgb, ${levelColor} 25%, transparent)` }}>{levelLabel}</span> | |
| </div> | |
| {hrView.screen_summary && ( | |
| <p className="hr-summary-box"> | |
| <span className="font-bold">筛选总结: </span>{hrView.screen_summary} | |
| </p> | |
| )} | |
| </div> | |
| ) | |
| } | |
| if (dataUnavailable) { | |
| return ( | |
| <div className="card opacity-5"> | |
| <h4 className="font-bold">{dimension}</h4> | |
| <p className="text-secondary mt-8">数据暂不可用</p> | |
| </div> | |
| ) | |
| } | |
| if (viewType === 'hr') { | |
| const conclusion = score >= 70 ? 'OK ✓' : score >= 40 ? '⚠️' : '✗' | |
| const finding = evidence.length > 0 ? evidence[0].text : '暂无关键发现' | |
| return ( | |
| <div className="card"> | |
| <div className="flex-between flex-wrap-mobile"> | |
| <h4 className="font-bold">{dimension}</h4> | |
| <span className="text-lg font-bold">{conclusion}</span> | |
| </div> | |
| <p className="text-secondary mt-8">{finding}</p> | |
| {footnote && ( | |
| <p className="text-sm text-light mt-8 py-8 px-12 bg-primary-soft"> | |
| {footnote} | |
| </p> | |
| )} | |
| </div> | |
| ) | |
| } | |
| const evidenceObj = Array.isArray(evidence) ? (evidence.length > 0 ? evidence[0] : null) : evidence | |
| const hasJdQuote = evidenceObj && (evidenceObj.jd_quote || evidenceObj.resume_quote) | |
| if (hasJdQuote) { | |
| return ( | |
| <div className="card"> | |
| <div className="flex-between flex-wrap-mobile"> | |
| <h4 className="font-bold">{dimension}</h4> | |
| <span className="text-lg font-bold">{score}%</span> | |
| </div> | |
| <div className="progress-bar-md progress-bar-bg-md mt-12"> | |
| <div className="progress-bar-fill" style={{ width: `${score}%`, backgroundColor: 'var(--color-primary)' }} /> | |
| </div> | |
| <div className="grid-2 gap-12 mt-16"> | |
| <div className="jd-quote-box"> | |
| <p className="font-bold text-sm mb-4">📋 JD要求</p> | |
| <p className="text-sm text-secondary" style={{ wordBreak: 'break-word' }}>{evidenceObj.jd_quote}</p> | |
| </div> | |
| <div className="resume-quote-box"> | |
| <p className="font-bold text-sm mb-4">📝 简历匹配</p> | |
| <p className="text-sm text-secondary" style={{ wordBreak: 'break-word' }}>{evidenceObj.resume_quote}</p> | |
| </div> | |
| </div> | |
| </div> | |
| ) | |
| } | |
| return ( | |
| <div className="card"> | |
| <div className="flex-between flex-wrap-mobile"> | |
| <h4 className="font-bold">{dimension}</h4> | |
| <span className="text-lg font-bold">{score}%</span> | |
| </div> | |
| <div className="progress-bar-md progress-bar-bg-md mt-12"> | |
| <div className="progress-bar-fill" style={{ width: `${score}%`, backgroundColor: 'var(--color-primary)' }} /> | |
| </div> | |
| {(Array.isArray(evidence) && evidence.length > 0) && ( | |
| <ul className="mt-16 evidence-list"> | |
| {evidence.map((item, i) => ( | |
| <li key={i} className="evidence-item"> | |
| <span className="text-primary" style={{ wordBreak: 'break-word' }}>{item.text}</span> | |
| {item.source && ( | |
| <span className="evidence-source">— {item.source}</span> | |
| )} | |
| </li> | |
| ))} | |
| </ul> | |
| )} | |
| </div> | |
| ) | |
| } | |
| export default ReportCard | |