/* eslint-disable @typescript-eslint/no-explicit-any */
import { TailwindPlayCommonParams } from '@/TailwindPlay/Fields/types.js';
import { InvalidField } from '@/TailwindPlay/Fields/Invalid.js';
import { extractHusarData } from '@/TailwindPlay/shared/extract.js';

export const FieldLocalImage: React.FC<TailwindPlayCommonParams> = (props) => {
  const { v, attributes } = extractHusarData(props);
  if (typeof v !== 'string' && v !== null && typeof v !== 'undefined') return <InvalidField />;

  return <img {...attributes} className="max-w-full object-contain" src={v} />;
};
