export const SettingsSchema = object(
reward_type: picklist(toArray(RewardType).map((value) => value.value)),
message: pipe(
string(),
),
)
minValue(2, 'The field must be at least 2.'),
maxValue(12, 'The field must not be greater than 12.'),
import * as v from 'valibot';
const Schema = v.union([
v.object({
reward_type: v.picklist(['dynamic'].map((value) => value)),
message: v.pipe(v.string()),
}),
v.object({
reward_type: v.literal('fixed'),
message: v.pipe(v.string(), v.minLength(2), v.maxLength(12)),
}),
]);