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

export const FieldFile: React.FC<TailwindPlayCommonParams> = (props) => {
  const { v, attributes } = extractHusarData(props);
  return (
    <a
      {...attributes}
      download={v?.split('/').pop()}
      href={v}
      className="flex flex-col gap-2 bg-foreground-100 p-4 rounded-lg"
    >
      {v}
    </a>
  );
};
