fixed some role based logic bugs; fixed ui parts
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 0s

This commit is contained in:
2025-03-17 20:53:45 +01:00
parent 5732554fe2
commit 9dcb3fd851
12 changed files with 175 additions and 160 deletions
+15 -2
View File
@@ -6,18 +6,31 @@ import { Icons } from "../icons";
function CategorySelect(props: Partial<ComboboxProps>) {
const { data: categories } = api.category.getMany.useQuery();
const initialValue = categories?.find(
(c) => c.id === props?.initialValue,
)?.slug;
return (
<Combobox
{...(props as ComboboxProps)}
initialValue={initialValue}
messageUi={{
select: "Kategorie auswählen...",
selectIcon: Icons.category,
placeholder: "Kategorie suchen...",
empty: "Keine Kategorien gefunden",
}}
onSelect={(value) => {
const id = categories?.find((c) => {
return c.slug === value;
})?.id!;
props?.onSelect?.(id);
}}
data={
categories?.map(({ name, slug }) => ({ label: name, value: slug })) ??
[]
categories?.map(({ name, slug }) => ({
label: name,
value: slug,
})) ?? []
}
/>
);