/**
 * Payload field validator for href/link fields.
 * Ensures values start with `/`, `http://`, or `https://`
 * to prevent malformed or relative URLs.
 */
export const validateHref = (value: string | null | undefined) => {
  if (
    value &&
    !value.startsWith('/') &&
    !value.startsWith('http://') &&
    !value.startsWith('https://')
  ) {
    return 'Zieladresse muss mit "/", "http://" oder "https://" beginnen'
  }
  return true
}