import { addProjectAction, deleteProjectAction, editProjectAction } from "@/app/(app)/settings/actions" import { CrudTable } from "@/components/settings/crud" import { getCurrentUser } from "@/lib/auth" import { randomHexColor } from "@/lib/utils" import { getProjects } from "@/models/projects" import { Prisma } from "@/prisma/client" export default async function ProjectsSettingsPage() { const user = await getCurrentUser() const projects = await getProjects(user.id) const projectsWithActions = projects.map((project) => ({ ...project, isEditable: true, isDeletable: true, })) return (

Projects

Use projects to differentiate between the type of activities you do For example: Freelancing, YouTube channel, Blogging. Projects are just a convenient way to separate statistics.

{ "use server" return await deleteProjectAction(user.id, code) }} onAdd={async (data) => { "use server" return await addProjectAction(user.id, data as Prisma.ProjectCreateInput) }} onEdit={async (code, data) => { "use server" return await editProjectAction(user.id, code, data as Prisma.ProjectUpdateInput) }} />
) }