diff --git a/apps/admin/.eslintrc.js b/apps/admin/.eslintrc.js deleted file mode 100644 index 428dea31..00000000 --- a/apps/admin/.eslintrc.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = { - root: true, - extends: ["custom"], - parserOptions: { - babelOptions: { - presets: [require.resolve('next/babel')], - }, - }, -}; diff --git a/apps/admin/.gitignore b/apps/admin/.gitignore deleted file mode 100644 index 1437c53f..00000000 --- a/apps/admin/.gitignore +++ /dev/null @@ -1,34 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# next.js -/.next/ -/out/ - -# production -/build - -# misc -.DS_Store -*.pem - -# debug -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# local env files -.env.local -.env.development.local -.env.test.local -.env.production.local - -# vercel -.vercel diff --git a/apps/admin/@/constants/index.ts b/apps/admin/@/constants/index.ts deleted file mode 100644 index c8d176b1..00000000 --- a/apps/admin/@/constants/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -import * as routers from "./routes" - -export const DEFAULT_TAG_PAGE_LIMIT = 40 - -export const DEFAULT_PAGE_LIMIT = 20 - -export { routers } diff --git a/apps/admin/@/constants/order.ts b/apps/admin/@/constants/order.ts deleted file mode 100644 index 0f45d9f7..00000000 --- a/apps/admin/@/constants/order.ts +++ /dev/null @@ -1,12 +0,0 @@ -export enum ORDER_BY { - created_at_asc = "created_at_asc", - created_at_desc = "created_at_desc", - updated_at_asc = "updated_at_asc", - updated_at_desc = "updated_at_desc", - total_like_asc = "total_like_asc", - total_like_desc = "total_like_desc", - total_comment_asc = "total_comment_asc", - total_comment_desc = "total_comment_desc", - // total_view_asc = "total_view_asc", - // total_view_desc = "total_view_desc", -} diff --git a/apps/admin/@/constants/routes.ts b/apps/admin/@/constants/routes.ts deleted file mode 100644 index 44903f98..00000000 --- a/apps/admin/@/constants/routes.ts +++ /dev/null @@ -1,73 +0,0 @@ -const APP_ROUTES = { - DASHBOARD: "/", - - POST: { - LIST: "/posts", - DETAIL: "/posts/:id", - ADD: "/posts/add", - EDIT: "/posts/edit/:id", - }, - - TAG: { - LIST: "/tags", - DETAIL: "/tags/:id", - ADD: "/tags/add", - EDIT: "/tags/edit/:id", - }, - - ASSETS: { - LIST: "/assets", - DETAIL: "/assets/:id", - ADD: "/assets/add", - EDIT: "/assets/edit/:id", - }, - - CATEGORY: { - LIST: "/categories", - DETAIL: "/categories/:id", - ADD: "/categories/add", - EDIT: "/categories/edit/:id", - }, - - USER: { - LIST: "/users", - DETAIL: "/users/:id", - ADD: "/users/add", - EDIT: "/users/edit/:id", - }, - - ROLE: { - LIST: "/roles", - DETAIL: "/roles/:id", - ADD: "/roles/add", - EDIT: "/roles/edit/:id", - }, - - PERMISSION: { - LIST: "/permissions", - DETAIL: "/permissions/:id", - ADD: "/permissions/add", - EDIT: "/permissions/edit/:id", - }, - - SETTINGS: { - LIST: "/settings", - DETAIL: "/settings/:id", - ADD: "/settings/add", - EDIT: "/settings/edit/:id", - }, - - LOGIN: "/login", - FORGOT_PASSWORD: "/forgot-password", - RESET_PASSWORD: "/reset-password", - REGISTER: "/register", - PROFILE: "/profile", - PROFILE_EDIT: "/profile/edit", - - NOT_FOUND: "/404", - SERVER_ERROR: "/500", - UNAUTHORIZED: "/401", - FORBIDDEN: "/403", -} - -export default APP_ROUTES diff --git a/apps/admin/@/font/index.ts b/apps/admin/@/font/index.ts deleted file mode 100644 index 4d836bd8..00000000 --- a/apps/admin/@/font/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Bebas_Neue } from "next/font/google" - -export const bebasNeue = Bebas_Neue({ - display: "swap", - weight: "400", - subsets: ["latin"], -}) diff --git a/apps/admin/@/messages/en.json b/apps/admin/@/messages/en.json deleted file mode 100644 index 25e5be13..00000000 --- a/apps/admin/@/messages/en.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "common": { - "home": "Home", - "tags": "Tags", - "tag": "Tag", - "categories": "Categories", - "category": "Category", - "posts": "Posts", - "total_post_plural": "Total {total} {total, plural, =0 {post} =1 {post} other {posts}}", - "post": "{total, plural, =0 {post} =1 {post} other {posts}}", - "pages": "Pages", - "page": "Page", - "comments": "Comments", - "comment": "Comment", - "users": "Users", - "user": "User", - "settings": "Settings", - "setting": "Setting", - "general": "General", - "advanced": "Advanced", - "info": "Info", - "help": "Help", - "helpCenter": "Help Center", - "about": "About", - "contact": "Contact", - "login": "Login", - "logout": "Logout", - "register": "Register", - "profile": "Profile", - "search": "Search", - "searchPlaceholder": "Enter your search here...", - "searchResults": "Search Results", - "searchNoResults": "No results found", - "searching": "Searching...", - "searchingFor": "Searching for", - "searchingIn": "Searching in", - "searchingForIn": "Searching for {0} in {1}", - "searchingForInWith": "Searching for {0} in {1} with {2}", - "searchingForWith": "Searching for {0} with {1}", - "searchingInWith": "Searching in {0} with {1}", - "forgotPassword": "Forgot Password", - "resetPassword": "Reset Password", - "resetPasswordSuccess": "Password reset successful", - "resetPasswordFailed": "Password reset failed", - "resetPasswordInstructions": "Enter your email address and we'll send you a link to reset your password", - "resetPasswordInstructionsSent": "We've sent you an email with instructions on how to reset your password", - "resetPasswordInstructionsFailed": "Failed to send reset password instructions", - "resetPasswordInstructionsResent": "We've resent the email with instructions on how to reset your password", - "email": "Email", - "password": "Password", - "passwordConfirm": "Confirm Password", - "passwordMismatch": "Passwords do not match", - "passwordReset": "Password Reset", - "passwordResetSuccess": "Password reset successful", - "passwordResetFailed": "Password reset failed", - "address": "Address", - "city": "City", - "state": "State", - "zip": "Zip", - "country": "Country", - "phone": "Phone", - "fax": "Fax", - "mobile": "Mobile", - "website": "Website", - "write": "Write", - "signIn": "Sign In", - "trending": "Trending", - "signOut": "Logout", - "light": "Light", - "dark": "Dark", - "system": "System", - "toggleTheme": "Toggle Theme", - "selectLocale": "Select Locale", - "follow": "Follow", - "unfollow": "Unfollow", - "followers": "Followers", - "following": "Following", - "update_profile": "Update profile", - "like": "Like", - "like_plural": "{count, plural, =0 {# like} =1 {# like} other {# likes}}", - "unlike": "Unlike", - "edit": "Edit", - "delete": "Delete", - "publish": "Publish", - "draft": "Draft", - "save": "Save", - "cancel": "Cancel", - "create": "Create", - "preview": "Preview", - "no_items_founded": "There are no items founded.", - "english": "English", - "french": "French", - "created_at_asc": "Recently created", - "created_at_desc": "Oldest created", - "updated_at_asc": "Recently updated", - "updated_at_desc": "Oldest updated", - "total_like_asc": "Least liked", - "total_like_desc": "Most liked", - "total_comment_asc": "Least commented", - "total_comment_desc": "Most commented", - "likers": "Likers", - "filter": "Filter", - "filter_by_placeholder": "Type your filter here...", - "filter_tag": "Filter by tag name..." - } -} diff --git a/apps/admin/@/messages/fr.json b/apps/admin/@/messages/fr.json deleted file mode 100644 index 03276504..00000000 --- a/apps/admin/@/messages/fr.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "common": { - "home": "Maison", - "tags": "Mots clés", - "tag": "Balise", - "categories": "Catégories", - "category": "Catégorie", - "posts": "Des postes", - "post": "{total, plural, =0 {poste} =1 {poste} other {des postes}}", - "pages": "Pages", - "page": "Page", - "comments": "Comments", - "comment": "Comment", - "users": "Users", - "user": "User", - "settings": "Paramètres", - "setting": "Paramètre", - "general": "General", - "advanced": "Advanced", - "info": "Info", - "help": "Help", - "helpCenter": "Help Center", - "about": "À propos", - "contact": "Contact", - "login": "Login", - "logout": "Logout", - "register": "Register", - "profile": "Profil", - "search": "Recherche", - "searchPlaceholder": "Recherche...", - "searchResults": "Search Results", - "searchNoResults": "No results found", - "searching": "Searching...", - "searchingFor": "Searching for", - "searchingIn": "Searching in", - "searchingForIn": "Searching for {0} in {1}", - "searchingForInWith": "Searching for {0} in {1} with {2}", - "searchingForWith": "Searching for {0} with {1}", - "searchingInWith": "Searching in {0} with {1}", - "forgotPassword": "Forgot Password", - "resetPassword": "Reset Password", - "resetPasswordSuccess": "Password reset successful", - "resetPasswordFailed": "Password reset failed", - "resetPasswordInstructions": "Enter your email address and we'll send you a link to reset your password", - "resetPasswordInstructionsSent": "We've sent you an email with instructions on how to reset your password", - "resetPasswordInstructionsFailed": "Failed to send reset password instructions", - "resetPasswordInstructionsResent": "We've resent the email with instructions on how to reset your password", - "email": "Email", - "password": "Password", - "passwordConfirm": "Confirm Password", - "passwordMismatch": "Passwords do not match", - "passwordReset": "Password Reset", - "passwordResetSuccess": "Password reset successful", - "passwordResetFailed": "Password reset failed", - "address": "Address", - "city": "City", - "state": "State", - "zip": "Zip", - "country": "Country", - "phone": "Phone", - "fax": "Fax", - "mobile": "Mobile", - "website": "Website", - "write": "écrire", - "signIn": "S'identifier", - "trending": "Tendance", - "signOut": "Se déconnecter", - "light": "Lumière", - "dark": "Sombre", - "system": "Système", - "toggleTheme": "Changer de thème", - "selectLocale": "Sélectionnez votre langue", - "follow": "Follow", - "unfollow": "Unfollow", - "followers": "Followers", - "following": "Following" - } -} diff --git a/apps/admin/@/molecules/input-title/index.tsx b/apps/admin/@/molecules/input-title/index.tsx deleted file mode 100644 index 7000241b..00000000 --- a/apps/admin/@/molecules/input-title/index.tsx +++ /dev/null @@ -1,34 +0,0 @@ -"use client" - -import TextareaAutosize from "react-textarea-autosize" - -type InputTitleProps = { - title?: string - placeholder?: string - name: string - onChange?: (e: React.ChangeEvent) => void - onBlur?: (e: React.FocusEvent) => void -} - -const InputTitle: React.FunctionComponent = ({ - placeholder = "", - name, - onChange, - onBlur, - ...props -}: InputTitleProps) => { - return ( -
- -
- ) -} - -export default InputTitle diff --git a/apps/admin/@/molecules/language-switcher/index.tsx b/apps/admin/@/molecules/language-switcher/index.tsx deleted file mode 100644 index 73f6d13c..00000000 --- a/apps/admin/@/molecules/language-switcher/index.tsx +++ /dev/null @@ -1,54 +0,0 @@ -"use client" - -import { useTransition } from "react" -import { useParams } from "next/navigation" - -import { locales } from "i18n" -import { useTranslations } from "next-intl" -import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue } from "ui" - -import { usePathname, useRouter } from "@/utils/navigation" - -const LanguageSwitcher = () => { - const router = useRouter() - const params = useParams<{ lang: string }>() - const { lang } = params - const pathname = usePathname() - const [isPending, startTransition] = useTransition() - const t = useTranslations() - - const handleLanguageChange = (selectedLocale) => { - const pathnameParts = pathname.split("/") - if (locales.includes(pathnameParts[1])) { - pathnameParts[1] = selectedLocale - } else { - pathnameParts[0] = `/${selectedLocale}` - } - - startTransition(() => { - router.replace(pathname, { locale: selectedLocale }) - }) - } - - return ( - - ) -} - -export default LanguageSwitcher diff --git a/apps/admin/@/molecules/list-summary/index.tsx b/apps/admin/@/molecules/list-summary/index.tsx deleted file mode 100644 index 03400375..00000000 --- a/apps/admin/@/molecules/list-summary/index.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import React from "react" - -import { useTranslations } from "next-intl" -import { Typography } from "ui" - -interface ListSummaryProps { - total?: number - subTotal?: number -} - -const ListSummary: React.FC = ({ total = 0, subTotal = 0 }) => { - const t = useTranslations() - - return ( -
-
- {t("common.total_post_plural", { total, sub_total: subTotal })} -
-
-
- ) -} - -export default ListSummary diff --git a/apps/admin/@/molecules/nav/index.module.css b/apps/admin/@/molecules/nav/index.module.css deleted file mode 100644 index 08c355b6..00000000 --- a/apps/admin/@/molecules/nav/index.module.css +++ /dev/null @@ -1,4 +0,0 @@ -.logo { - -webkit-text-strokes: 1px; - -webkit-text-stroke-color: #000; -} \ No newline at end of file diff --git a/apps/admin/@/molecules/nav/index.tsx b/apps/admin/@/molecules/nav/index.tsx deleted file mode 100644 index 5e319c9d..00000000 --- a/apps/admin/@/molecules/nav/index.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import Link from "next/link" - -import { getTranslations } from "next-intl/server" - -import { getServerSession } from "@/utils/auth" - -import { UserNav } from "../user-nav" -import Logo from "./logo" -import ThemeToggle from "./theme-toggle" - -export default async function Nav() { - const session = await getServerSession() - const t = await getTranslations() - - return ( -
-
- - -
- {session?.user ? ( -
- -
- ) : ( -
- - {t("common.signIn")} - -
- )} - -
-
-
- ) -} diff --git a/apps/admin/@/molecules/nav/logo.tsx b/apps/admin/@/molecules/nav/logo.tsx deleted file mode 100644 index 55f5e8d8..00000000 --- a/apps/admin/@/molecules/nav/logo.tsx +++ /dev/null @@ -1,25 +0,0 @@ -"use client" - -import React from "react" -import Link from "next/link" - -import { cn } from "ui" - -import { bebasNeue } from "@/font" - -const Logo: React.FC = () => { - return ( - -

- NEXT-FORUM -

- - ) -} - -export default Logo diff --git a/apps/admin/@/molecules/nav/search-bar.tsx b/apps/admin/@/molecules/nav/search-bar.tsx deleted file mode 100644 index 7d42017c..00000000 --- a/apps/admin/@/molecules/nav/search-bar.tsx +++ /dev/null @@ -1,124 +0,0 @@ -"use client" - -import { useEffect, useRef, useState } from "react" -import { useRouter, useSearchParams } from "next/navigation" - -import { X } from "lucide-react" -import { useTranslations } from "next-intl" - -import { Input } from "@/components/ui/input" - -import { cn } from "../../lib/utils" -import { Button } from "./button" - -export default function SearchBar() { - const t = useTranslations() - const searchParams = useSearchParams() - const searchTermParams = searchParams?.get("search") || "" - const [searchTerm, setSearchTerm] = useState(searchTermParams) - const router = useRouter() - - const inputRef = useRef(null) - - const onSearch = () => { - const newSearchParams = new URLSearchParams(searchParams) - - newSearchParams.set("search", searchTerm) - - router.push("/search" + "?" + newSearchParams.toString()) - } - - const onClear = () => { - setSearchTerm("") - router.push("/") - } - - useEffect(() => { - setSearchTerm(searchTermParams) - }, [searchTermParams]) - - useEffect(() => { - const handleKeyDown = (e: KeyboardEvent) => { - if (e.key === "k" && (e.metaKey || e.ctrlKey)) { - e.preventDefault() - inputRef.current?.focus() - } - if (e.key === "Escape") { - onClear() - inputRef.current?.blur() - } - } - - window.addEventListener("keydown", handleKeyDown) - - return () => { - window.removeEventListener("keydown", handleKeyDown) - } - }, []) - - return ( -
- { - setSearchTerm(e.target.value) - }} - onKeyDown={(e) => { - if (e.key === "Enter") { - onSearch() - } - }} - /> - { -
- {searchTerm && ( - <> - - - - )} - {!searchTerm && ( - - )} -
- } -
- ) -} diff --git a/apps/admin/@/molecules/nav/theme-toggle.tsx b/apps/admin/@/molecules/nav/theme-toggle.tsx deleted file mode 100644 index b617db73..00000000 --- a/apps/admin/@/molecules/nav/theme-toggle.tsx +++ /dev/null @@ -1,41 +0,0 @@ -"use client" - -import React from "react" - -import { MoonIcon, SunIcon } from "lucide-react" -import { useTranslations } from "next-intl" -import { useTheme } from "next-themes" -import { - Button, - DropdownMenu, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuTrigger, -} from "ui" - -const ThemeToggle: React.FC = () => { - const { setTheme } = useTheme() - const t = useTranslations() - - return ( - - - - - - setTheme("light")}>{t("common.light")} - setTheme("dark")}>{t("common.dark")} - setTheme("system")}>{t("common.system")} - - - ) -} - -export default ThemeToggle diff --git a/apps/admin/@/molecules/no-item-founded/index.tsx b/apps/admin/@/molecules/no-item-founded/index.tsx deleted file mode 100644 index 98363271..00000000 --- a/apps/admin/@/molecules/no-item-founded/index.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import React from "react" - -import { useTranslations } from "next-intl" - -import { cn } from "../../lib/utils" -import Typography from "../typography" - -type NoItemFoundedProps = { - className?: string -} - -const NoItemFounded: React.FC = ({ className = "" }) => { - const t = useTranslations() - - return ( -
-
- -
- - {t("common.no_items_founded")} -
- ) -} - -export default NoItemFounded diff --git a/apps/admin/@/molecules/page-title/index.tsx b/apps/admin/@/molecules/page-title/index.tsx deleted file mode 100644 index f3b41cbd..00000000 --- a/apps/admin/@/molecules/page-title/index.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import React from "react" - -import { Typography } from "ui" - -export type PageTitleProps = { - title: string - description?: string -} - -export default function PageTitle({ title, description }: PageTitleProps) { - return ( -
- - {title} - - {description && {description}} -
- ) -} diff --git a/apps/admin/@/molecules/pagination/index.tsx b/apps/admin/@/molecules/pagination/index.tsx deleted file mode 100644 index 92721f17..00000000 --- a/apps/admin/@/molecules/pagination/index.tsx +++ /dev/null @@ -1,63 +0,0 @@ -"use client" - -import React from "react" -import { useSearchParams } from "next/navigation" - -import { - Pagination, - PaginationContent, - PaginationLink, - PaginationNext, - PaginationPrevious, -} from "@/components/ui/pagination" - -interface PaginationProps { - totalPages: number - baseUrl: string -} - -const generatePaginationPath = (baseUrl: string, page: number, searchParams: URLSearchParams) => { - searchParams.set("page", String(page)) - return `${baseUrl}?${searchParams.toString()}` -} - -const CustomPagination: React.FC = ({ baseUrl, totalPages }) => { - const searchParams = useSearchParams() - const currentSearchParams = new URLSearchParams(Array.from(searchParams.entries())) - - const currentPage = Number(searchParams.get("page")) || 1 - - return ( - - - 1 - ? generatePaginationPath(baseUrl, currentPage - 1, currentSearchParams) - : "#" - } - isActive={currentPage > 1} - /> - {Array.from({ length: totalPages }, (_, i) => ( - - {i + 1} - - ))} - - - - ) -} - -export default CustomPagination diff --git a/apps/admin/@/molecules/post-form/index.tsx b/apps/admin/@/molecules/post-form/index.tsx deleted file mode 100644 index 30ffcf88..00000000 --- a/apps/admin/@/molecules/post-form/index.tsx +++ /dev/null @@ -1,190 +0,0 @@ -"use client" - -import Link from "next/link" -import { useParams } from "next/navigation" - -import { zodResolver } from "@hookform/resolvers/zod" -import { Prisma } from "database" -import dayjs from "dayjs" -import { ArrowLeft } from "lucide-react" -import { useFormStatus } from "react-dom" -import { Controller, useForm } from "react-hook-form" -import AsyncCreatableSelect from "react-select/async-creatable" -import { toast } from "react-toastify" -import z from "zod" - -import { createPost, updatePost } from "@/actions/protect/posts" -import Editor from "@/molecules/editor" -import InputTitle from "@/molecules/input-title" -import { TPostItem } from "@/types/posts" - -import { cn } from "../../lib/utils" -import { Button, buttonVariants } from "./button" - -const PostForm = ({ post: postData }: { post?: TPostItem }) => { - const { title = "", content = "", tagOnPost = [] } = postData || {} - - const { postId } = useParams() - const { pending } = useFormStatus() - - const postSchema = z.object({ - title: z.string(), - tags: z - .array( - z.object({ - label: z.string(), - value: z.string(), - id: z.string().optional().nullable(), - __isNew__: z.boolean().optional().nullable(), - }) - ) - .max(5, "You can only add up to 5 tags") - .optional() - .nullable(), - content: z - .string() - .max(10000, "Content must be at most 10000 characters") - .optional() - .nullable(), - }) satisfies z.ZodType> - - const { - control, - handleSubmit, - formState: { isValid }, - } = useForm({ - defaultValues: { - title, - tags: tagOnPost?.map((tag) => ({ - id: tag?.tag?.id, - label: tag?.tag?.name, - value: tag?.tag?.id, - __isNew__: false, - })), - content, - }, - resolver: zodResolver(postSchema), - }) - - const handleSubmitPost = async (data) => { - try { - if (postId) { - await updatePost(postId as string, { - ...data, - }) - } else { - await createPost({ - ...data, - }) - } - } catch (error) { - toast.error(error.message) - } - } - - const promiseOptions = async (inputValue: string) => { - const rawData = await fetch("/api/protected/tags?search=" + inputValue) - const tags = await rawData.json() - - return tags.map((tag) => ({ - label: tag.name, - value: tag.id, - })) - } - - return ( -
-
-
- - -
back
- -
-
- {postData && ( -
-
Lasted updated at:
-
- {dayjs(postData?.updatedAt).format("DD MMM YYYY - HH:mm")} -
-
- )} -
-
-
-
-
-
- ( - - )} - /> -
- -
- ( - - )} - /> -
- -
- ( - - )} - /> -
-
-
- -
- - Cancel - - -
-
-
- ) -} - -export default PostForm diff --git a/apps/admin/@/molecules/profile/index.tsx b/apps/admin/@/molecules/profile/index.tsx deleted file mode 100644 index c1464706..00000000 --- a/apps/admin/@/molecules/profile/index.tsx +++ /dev/null @@ -1,190 +0,0 @@ -"use client" - -import React from "react" - -import { useForm } from "react-hook-form" - -import { Input } from "@/components/ui/input" -import { Label } from "@/components/ui/label" -import { Textarea } from "@/components/ui/textarea" -import APP_APIS from "@/constants/apis" -import { TUserItem } from "@/types/users" -import { generatePath } from "@/utils/generatePath" - -import Typography from "../typography" -import { Button } from "./button" - -type ProfileType = { - user: TUserItem -} - -const Profile: React.FC = ({ user }) => { - const { register, handleSubmit } = useForm< - TUserItem & { - firstName: string - lastName: string - } - >({ - defaultValues: { - name: user?.name, - firstName: user?.name, - lastName: user?.name, - email: user?.email, - address: user?.address, - phone: user?.phone, - twitter: user?.twitter, - github: user?.github, - facebook: user?.facebook, - bio: user?.bio, - }, - }) - - const onSubmit = async (user: TUserItem) => { - try { - // Post to API - await fetch( - generatePath(APP_APIS.protected.user.UPDATE, { - userId: user.id, - }), - { - method: "PUT", - body: JSON.stringify({ - ...user, - // name: `${firstName} ${lastName}`, - }), - headers: { - "Content-Type": "application/json", - }, - } - ) - } catch (error) {} - } - - return ( -
-
-
- Account - -
- - -
- -
-
- - -
-
- - -
-
- -
- - -
- -
- - -
- - {/*
- - -
*/} - -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- -