// react import React, { useState } from "react"; // next import Image from "next/image"; import { Controller, useForm } from "react-hook-form"; import { observer } from "mobx-react-lite"; // mobx store import { useMobxStore } from "lib/mobx/store-provider"; // components import { Button, Input } from "@plane/ui"; import DummySidebar from "components/account/sidebar"; import OnboardingStepIndicator from "components/account/step-indicator"; // types import { IUser } from "types"; // constants import { TIME_ZONES } from "constants/timezones"; // assets import IssuesSvg from "public/onboarding/onboarding-issues.svg"; import { ImageUploadModal } from "components/core"; // icons import { Camera, User2 } from "lucide-react"; const defaultValues: Partial = { first_name: "", avatar: "", use_case: undefined, }; type Props = { user?: IUser; }; const timeZoneOptions = TIME_ZONES.map((timeZone) => ({ value: timeZone.value, query: timeZone.label + " " + timeZone.value, content: timeZone.label, })); export const UserDetails: React.FC = observer((props) => { const { user } = props; const [isRemoving, setIsRemoving] = useState(false); const [selectedUsecase, setSelectedUsecase] = useState(); const [isImageUploadModalOpen, setIsImageUploadModalOpen] = useState(false); const { user: userStore } = useMobxStore(); const { handleSubmit, control, watch, setValue, formState: { errors, isSubmitting, isValid }, } = useForm({ defaultValues, }); const onSubmit = async (formData: IUser) => { if (!user) return; const payload: Partial = { ...formData, first_name: formData.first_name.split(" ")[0], last_name: formData.first_name.split(" ")[1], use_case: formData.use_case, onboarding_step: { ...user.onboarding_step, profile_complete: true, }, }; await userStore.updateCurrentUser(payload); }; const useCases = [ "Build Products", "Manage Feedbacks", "Service delivery", "Field force management", "Code Repository Integration", "Bug Tracking", "Test Case Management", "Rescource allocation", ]; return (
setIsImageUploadModalOpen(false)} isRemoving={isRemoving} handleDelete={() => {}} onSuccess={(url) => { setValue("avatar", url); setIsImageUploadModalOpen(false); }} value={watch("avatar") !== "" ? watch("avatar") : undefined} userImage />

What do we call you?

( )} />
(

And how will you use Plane{value.length>0?", ":""}{value}?

)} />

Choose just one

(
{useCases.map((useCase) => (
onChange(useCase)} > {useCase}
))}
)} />
); });