docs/src/pages/premium-themes/onepirate/modules/form/validation.ts/required
export function required(
  requiredFields: string[],
  values: Record<string, string>,
): Record<string, string> {
  return requiredFields.reduce(
    (fields, field) => ({
      ...fields,
      ...(isDirty(values[field]) ? undefined : { [field]: 'Required' }),
    }),
    {},
  );
}