mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-17 13:23:35 +00:00
refactor: improve handling of multi-fields
This commit is contained in:
committed by
Carlos Valente
parent
b2b115c329
commit
5c86914cda
@@ -18,19 +18,21 @@ import {
|
||||
import { isStringBoolean } from '../../../features/viewers/common/viewUtils';
|
||||
|
||||
import InlineColourPicker from './InlineColourPicker';
|
||||
import { ParamField } from './types';
|
||||
import { ParamField } from './viewParams.types';
|
||||
|
||||
interface EditFormInputProps {
|
||||
interface ParamInputProps {
|
||||
paramField: ParamField;
|
||||
}
|
||||
|
||||
export default function ParamInput(props: EditFormInputProps) {
|
||||
const { paramField } = props;
|
||||
export default function ParamInput({ paramField }: ParamInputProps) {
|
||||
const [searchParams] = useSearchParams();
|
||||
const { id, type, defaultValue } = paramField;
|
||||
|
||||
if (type === 'persist') {
|
||||
return null;
|
||||
if (!paramField.values || !paramField.values.length) {
|
||||
return null;
|
||||
}
|
||||
return <input hidden name={id} readOnly value={paramField.values.join(',')} />;
|
||||
}
|
||||
|
||||
if (type === 'option') {
|
||||
|
||||
Reference in New Issue
Block a user