feat: bugfixes, spedup, bulk actions,

This commit is contained in:
Vasily Zubarev
2025-03-17 18:36:25 +01:00
parent b27f07043e
commit 14967e1c85
34 changed files with 433 additions and 225 deletions

View File

@@ -2,6 +2,7 @@
import { Category } from "@prisma/client"
import { SelectProps } from "@radix-ui/react-select"
import { useMemo } from "react"
import { FormSelect } from "./simple"
export const FormSelectCategory = ({
@@ -11,13 +12,9 @@ export const FormSelectCategory = ({
placeholder,
...props
}: { title: string; categories: Category[]; emptyValue?: string; placeholder?: string } & SelectProps) => {
return (
<FormSelect
title={title}
items={categories.map((category) => ({ code: category.code, name: category.name, color: category.color }))}
emptyValue={emptyValue}
placeholder={placeholder}
{...props}
/>
const items = useMemo(
() => categories.map((category) => ({ code: category.code, name: category.name, color: category.color })),
[categories]
)
return <FormSelect title={title} items={items} emptyValue={emptyValue} placeholder={placeholder} {...props} />
}