Actualizar frontend/src/components/UI.jsx
This commit is contained in:
@@ -35,11 +35,11 @@ export function Filters({ children }) {
|
|||||||
return <div className="filters">{children}</div>;
|
return <div className="filters">{children}</div>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Select({ label, value, options, onChange }) {
|
export function Select({ label, value, options, onChange, width }) {
|
||||||
return (
|
return (
|
||||||
<div className="filter-group">
|
<div className="filter-group" style={width ? { width } : undefined}>
|
||||||
{label && <label>{label}</label>}
|
{label && <label>{label}</label>}
|
||||||
<select value={value} onChange={(e) => onChange(e.target.value)}>
|
<select value={value} onChange={(e) => onChange(e.target.value)} style={width ? { width: "100%" } : undefined}>
|
||||||
{options.map((o) => {
|
{options.map((o) => {
|
||||||
const val = typeof o === "object" ? o.value : o;
|
const val = typeof o === "object" ? o.value : o;
|
||||||
const txt = typeof o === "object" ? o.label : o;
|
const txt = typeof o === "object" ? o.label : o;
|
||||||
|
|||||||
Reference in New Issue
Block a user