1
0
Fork 0

feat(org): Admin updates for curated sets

This commit is contained in:
Joost De Cock 2023-10-20 10:43:43 +02:00
parent a0754bf218
commit dba3c3731a
8 changed files with 176 additions and 12 deletions

View file

@ -130,6 +130,39 @@ export const ButtonFrame = ({
</button>
)
/*
* Input for integers
*/
export const NumberInput = ({
label, // Label to use
update, // onChange handler
valid, // Method that should return whether the value is valid or not
current, // The current value
original, // The original value
placeholder, // The placeholder text
docs = false, // Docs to load, if any
id = '', // An id to tie the input to the label
labelBL = false, // Bottom-Left label
labelBR = false, // Bottom-Right label
max = 0,
min = 220,
step = 1,
}) => (
<FormControl {...{ label, labelBL, labelBR, docs }} forId={id}>
<input
id={id}
type="number"
placeholder={placeholder}
value={current}
onChange={(evt) => update(evt.target.value)}
className={`input w-full input-bordered ${
current === original ? 'input-secondary' : valid(current) ? 'input-success' : 'input-error'
}`}
{...{ max, min, step }}
/>
</FormControl>
)
/*
* Input for strings
*/