'use client'; import React, { FC, useEffect, useState } from 'react'; import { Form, Upload, Button } from 'antd'; import type { UploadFile, UploadProps } from 'antd'; import ImgCrop from 'antd-img-crop'; import { CameraOutlined } from '@ant-design/icons'; import { Link } from '../../navigation'; import { CustomInput } from '../view'; import { Profile } from '../../types/profile'; import { useProfileSettings } from '../../actions/hooks/useProfileSettings'; type ProfileSettingsProps = { locale: string; photoDesc?: string; placeholderName?: string; placeholderSurname?: string; placeholderBirthday?: string; placeholderEmail?: string; changePasswordLink?: string; saveButton?: string; }; // type FileType = Parameters>[0]; export const ProfileSettings: FC = ({ locale, photoDesc, placeholderName, placeholderSurname, placeholderBirthday, placeholderEmail, changePasswordLink, saveButton }) => { const [form] = Form.useForm(); const { profileSettings } = useProfileSettings(locale); useEffect(() => { if (profileSettings) { form.setFieldsValue(profileSettings); } }, [profileSettings]); const [fileList, setFileList] = useState(); const onChange: UploadProps['onChange'] = ({ fileList: newFileList }) => { setFileList(newFileList); }; const onPreview = async (file: UploadFile) => { // let src = file.url as string; // if (!src) { // src = await new Promise((resolve) => { // const reader = new FileReader(); // reader.readAsDataURL(file.originFileObj as FileType); // reader.onload = () => resolve(reader.result as string); // }); // } // const image = new Image(); // image.src = src; // const imgWindow = window.open(src); // imgWindow?.document.write(image.outerHTML); }; return (
{photoDesc}
{/*
*/}
{changePasswordLink}
); };