export function getImageUrl(localValue: unknown, type: string): string {
  if (type === 'fileImageLink') {
    return (localValue as string) ?? '';
  }
  return (localValue as { url?: string })?.url ?? '';
}

export function haveImageValue(localValue: unknown, type: string): boolean {
  if (type === 'fileImageLink') {
    return !!localValue;
  }
  return !!(localValue as { url?: string })?.url;
}

export function clearImageValue(type: string): string | Record<string, never> {
  if (type === 'fileImageLink') {
    return '';
  }
  return {};
}
