feat(questions): add questions page with open count badge

Add /questions page and a nav badge with the open count.
Core decides which question is open. The page only shows and answers.
Move RatingStars out of BacklogCard so both pages share it.
This commit is contained in:
lobo committed 2026-10-09 09:31:48 +02:00
1 parent 1dab069a4d
commit d3ad19e2fa
15 files changed
+567 -33

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
import {useTranslation} from 'react-i18next';
import {Star} from 'lucide-react';
import {cn} from '@/lib/utils';
/**
* Five star buttons. Clicking the chosen star again sends 0, so the parent decides what that means.
*
* @param value 0 for no rating
* @param labelledBy id of the element that names the group
*/
export default function RatingStars({value, onChange, labelledBy, disabled}) {
const {t} = useTranslation();
return (
<div role="group" aria-labelledby={labelledBy} className="flex h-9 items-center gap-1">
{[1, 2, 3, 4, 5].map((n) => (
<button
key={n}
type="button"
disabled={disabled}
aria-label={t('BACKLOG.RATING_STARS', {count: n})}
aria-pressed={value === n}
onClick={() => onChange(value === n ? 0 : n)}
className="rounded-sm p-0.5 outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50"
>
<Star className={cn('size-6 transition-colors',
n <= value ? 'fill-amber-400 text-amber-400' : 'text-muted-foreground/40 hover:text-amber-400')}/>
</button>
))}
</div>
);
}