mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
handle translation AND onChange reture string
This commit is contained in:
@@ -1,14 +1,17 @@
|
||||
import { ChangeEvent, CSSProperties } from "react"
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook"
|
||||
|
||||
type Props = {
|
||||
className?: string,
|
||||
style?: CSSProperties,
|
||||
options?: BsmSelectOption[],
|
||||
onChange?: (value: any) => void
|
||||
onChange?: (value: string) => void
|
||||
}
|
||||
|
||||
export function BsmSelect({className, style, options, onChange}: Props) {
|
||||
|
||||
const t = useTranslation();
|
||||
|
||||
const handleChange = (event: ChangeEvent<HTMLSelectElement>) => {
|
||||
onChange?.(event.target.value);
|
||||
}
|
||||
@@ -16,7 +19,7 @@ export function BsmSelect({className, style, options, onChange}: Props) {
|
||||
return (
|
||||
<select className={className} style={style} onChange={handleChange}>
|
||||
{options && options.map(option => (
|
||||
<option key={option.value} value={option.value}>{option.text}</option>
|
||||
<option key={option.value} value={option.value}>{t(option.text)}</option>
|
||||
))}
|
||||
</select>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user