mirror of
https://github.com/marcogll/TaxHacker_s23.git
synced 2026-01-13 13:25:18 +00:00
feat: bugfixes, spedup, bulk actions,
This commit is contained in:
@@ -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} />
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user