'use client';

import { Button } from '@/components/ui';
import {
    UploadMenu,
    FileDropzone,
    TagsInput,
    SourceInput,
} from '@/components/upload';
import { PUBLISH_DISCLAIMER } from '@/lib/consts';

export default function Upload() {
    return (
        <div className="flex justify-between w-full">
            <UploadMenu />
            <form
                className="flex flex-col grow max-w-[900px] gap-5"
                onSubmit={(e) => {
                    console.log('SUBMIT');
                    e.preventDefault();

                    const formData = new FormData(e.currentTarget);
                    const data: any = Object.fromEntries(formData.entries());

                    console.log(data.files);
                }}
            >
                <FileDropzone />
                <TagsInput />
                <SourceInput />
                <span className="text-center text-sm">
                    {PUBLISH_DISCLAIMER}
                </span>
                <Button>Опубликовать</Button>
            </form>
        </div>
    );
}
