import { InputField } from '@/components/ui/inputfield';
import { Button } from '@/components/ui';
import { Separator } from '@/components/ui';
import { changeUsername } from './changeusername';
import { useState } from 'react';
import AboutMe from './AboutMe';
export default function ProfilePage() {
    const maxLength = 250;
    const [about, setAbout] = useState('');
    const [username, setUsername] = useState('');
    const [usernameLoading, setUsernameLoading] = useState(false);
    return (
        <div className="flex flex-col flex-start gap-[20px] w-[900px] h-[804px]">
            <div className="flex flex-col flex-start gap-[10px] w-[310px] h-[123px]">
                <p className="font-medium text-light-violet gap-[10px] ml-[20px]">
                    НИКНЕЙМ
                </p>

                <InputField
                    placeholder="Введите никнейм"
                    value={username}
                    onChange={(e: any) => setUsername(e.target.value)}
                />

                <Button
                    className="w-[105px]"
                    onClick={() => changeUsername(username)}
                    disabled={usernameLoading}
                >
                    {usernameLoading ? '...' : 'Сменить'}
                </Button>
            </div>
            <Separator className="bg-violet/50 h-[1px]" />
            <AboutMe />
            <Separator className="bg-violet/50 h-[1px]" />
            <div className="flex flex-col flex-start gap-[10px] w-[219px] h-[74px]">
                <p className="font-medium text-light-violet ml-[20px]">
                    АВАТАР
                </p>
                <div className="flex flex-row gap-[10px]">
                    <Button className="w-[105px]">Сменить</Button>
                    <Button variant={'danger'}>Удалить</Button>
                </div>
            </div>
            <Separator className="bg-violet/50 h-[1px]" />
            <div className="flex flex-col flex-start gap-[10px] w-[219px] h-[169px]">
                <p className="font-medium text-light-violet ml-[20px]">
                    ТЕМА БАННЕРА
                </p>

                <div className="flex flex-row flex-wrap items-center content-start gap-[5px] w-[265px] h-[85px]">
                    {Array.from({ length: 12 }).map((_, index) => (
                        <div
                            key={index}
                            className={`w-[40px] h-[40px] rounded-full cursor-pointer gradient-${index}`}
                        />
                    ))}
                </div>
                <div className="flex flex-row gap-[10px]">
                    <Button className="w-[105px]">Сменить</Button>
                    <Button variant={'danger'}>Удалить</Button>
                </div>
            </div>
            <Separator className="bg-violet/50 h-[1px]" />
            <div className="flex flex-col flex-start gap-[10px] w-[219px] h-[74px]">
                <p className="font-medium text-light-violet ml-[20px]">
                    БАННЕР
                </p>
                <div className="flex flex-row gap-[10px]">
                    <Button className="w-[105px]">Сменить</Button>
                    <Button variant={'danger'}>Удалить</Button>
                </div>
            </div>
        </div>
    );
}
