ci / docker (push) Successful in 13m22s
- verdicts table (per link, like ratings), PUT verdict endpoint, typed Verdict enum - share page: thumbs up/down, verdict filter with counts, view-scoped selection bar - lightbox: per-page shortcut table (P/X/U, 1-5/0, S), ? help overlay, action toast when a keyboard vote auto-advances - shared useLightbox hook; single keydown subscription reading live state via ref - album view: per-link thumbs and vote counts; share list shows accept/reject totals - feedback queries deduped and run concurrently; verdict counts in one scan
25 lines
748 B
React
25 lines
748 B
React
// Accept/reject vote. `value` is 'accept', 'reject' or null; clicking the
|
|
// active thumb clears it. Without onChange it renders read-only.
|
|
export default function Thumbs({ value, onChange, small }) {
|
|
const thumb = (verdict, glyph, label) => (
|
|
<button
|
|
type="button"
|
|
className={`thumb${value === verdict ? ' active' : ''}`}
|
|
disabled={!onChange}
|
|
onClick={(e) => {
|
|
e.stopPropagation()
|
|
onChange(value === verdict ? null : verdict)
|
|
}}
|
|
title={onChange ? label : undefined}
|
|
>
|
|
{glyph}
|
|
</button>
|
|
)
|
|
return (
|
|
<span className={`thumbs${small ? ' thumbs-small' : ''}`}>
|
|
{thumb('accept', '👍', 'Accept (P)')}
|
|
{thumb('reject', '👎', 'Reject (X)')}
|
|
</span>
|
|
)
|
|
}
|