diff --git a/.gitignore b/.gitignore index 51a0b1a8..8dc788bb 100644 --- a/.gitignore +++ b/.gitignore @@ -42,4 +42,7 @@ next-env.d.ts .vscode .contentlayer -venv \ No newline at end of file +venv + +# Turbo +.turbo \ No newline at end of file diff --git a/README.md b/README.md index ea25eb02..5f70f4a0 100644 --- a/README.md +++ b/README.md @@ -26,35 +26,55 @@ ## Introduction -Lets goooo - Next.js 14, Prisma, Planetscale, Auth.js, Resend, React Email, Shadcn/ui, and Stripe. +Lets goooo - Next.js 14, Turborepo, Prisma, Planetscale, Auth.js, Resend, React Email, Shadcn/ui, and Stripe.
All seamlessly integrated with the Projectx to accelerate the development. +## Directory Structure + +ProjectX is a monorepo managed by [Turborepo](https://turbo.fish/). The monorepo is split between `apps` and `packages` directories. + +- **Apps** are the Next.js apps that are deployed to Vercel (this is where most development is done). +- **Packages** are the shared packages that are used by the apps (e.g. `@projectx/components`) + +```` + ## Installation Clone & create this repo locally with the following command: ```bash git clone https://github.com/meglerhagen/projectx.git -``` +```` -1. Install dependencies using pnpm: +1. Install dependencies using yarn: ```sh yarn install ``` -2. Copy `.env.example` to `.env` and update the variables. +2. Move into the app directory (this is where the next.js app lives): + +```sh +cd apps/www +``` + +3. Copy `.env.example` to `.env.local` and update the variables. ```sh cp .env.example .env.local ``` -3. Input everything you need for the env. +4. Input everything you need for the env. -4. Start the development server: +5. Start the development server from either yarn or turbo: ```sh +# At the root of the mono repo +yarn dev + +# Or from the app directory +cd apps/www yarn dev ``` diff --git a/app/api/ai/generateDescription/route.ts b/app/api/ai/generateDescription/route.ts deleted file mode 100644 index 64ba49cf..00000000 --- a/app/api/ai/generateDescription/route.ts +++ /dev/null @@ -1,54 +0,0 @@ -// app/api/ai/generateDescription/route.ts -import { NextRequest, NextResponse } from "next/server"; -import axios from "axios"; - -export async function POST(request: NextRequest) { - const requestBody = await request.json(); - const { allResponses, text } = requestBody; - - // Construct messages for the chat completion request - const messages = allResponses.map((response) => { - return { - role: "user", - content: `Options: ${response.options.join(", ")}.`, - }; - }); - - console.log(messages); - - // Add the specific request text - messages.push({ - role: "system", - content: - "I need you to act like a real estate agent and write a description for this house. I need a title and a description", - }); - messages.push({ role: "user", content: text }); - - try { - const openaiResponse = await axios.post( - "https://api.openai.com/v1/chat/completions", - { - model: "gpt-4", - messages: messages, - }, - { - headers: { - Authorization: `Bearer ${process.env.OPENAI_API_KEY}`, - "Content-Type": "application/json", - }, - }, - ); - - // Extracting the assistant's response - const completion = openaiResponse.data.choices[0].message.content; - - // Send the assistant's response back to the client - return NextResponse.json({ description: completion }); - } catch (error) { - console.error("Error in generating description:", error); - return NextResponse.json( - { error: "Failed to generate description" }, - { status: 500 }, - ); - } -} diff --git a/.env.example b/apps/www/.env.example similarity index 100% rename from .env.example rename to apps/www/.env.example diff --git a/.eslintrc.json b/apps/www/.eslintrc.json similarity index 100% rename from .eslintrc.json rename to apps/www/.eslintrc.json diff --git a/apps/www/.gitignore b/apps/www/.gitignore new file mode 100644 index 00000000..51a0b1a8 --- /dev/null +++ b/apps/www/.gitignore @@ -0,0 +1,45 @@ +# 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* +.pnpm-debug.log* + +# local env files +.env*.local +.env + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts + +# email +/.react-email/ + +.vscode +.contentlayer + +venv \ No newline at end of file diff --git a/apps/www/.prettier.config.js b/apps/www/.prettier.config.js new file mode 100644 index 00000000..19c7d550 --- /dev/null +++ b/apps/www/.prettier.config.js @@ -0,0 +1,3 @@ +module.exports = { + ...require("../../prettier.config.js"), +}; diff --git a/apps/www/actions/account-switcher/get-workspace.ts b/apps/www/actions/account-switcher/get-workspace.ts new file mode 100644 index 00000000..5326906c --- /dev/null +++ b/apps/www/actions/account-switcher/get-workspace.ts @@ -0,0 +1,37 @@ +// actions/get-user-workspaces.js +"use server"; + +import { prisma } from "@/lib/db"; +import { getCurrentUser } from "@/lib/session"; + +export async function getUserWorkspaces() { + const user = await getCurrentUser(); + const userId = user?.id; + + // console.log(`Request received to get workspaces for User ID: ${userId}`); + + try { + const workspaceData = await prisma.workspace.findMany({ + where: { userId }, + select: { + id: true, + name: true, + // Include other fields as needed + }, + }); + + // Transform the workspace data + const transformedWorkspaces = workspaceData.map((ws) => ({ + workspaceName: ws.name, + email: user?.name, + icon: "vercel", + name: user?.name, + })); + + // console.log(`Workspaces retrieved successfully for user ID: ${userId}`); + return { success: true, workspaces: transformedWorkspaces }; + } catch (error) { + console.error(`Error retrieving workspaces for user ID: ${userId}`, error); + return { success: false, error: error.message }; + } +} \ No newline at end of file diff --git a/actions/generate-user-stripe.ts b/apps/www/actions/generate-user-stripe.ts similarity index 100% rename from actions/generate-user-stripe.ts rename to apps/www/actions/generate-user-stripe.ts diff --git a/actions/send-onboarding-email.ts b/apps/www/actions/send-onboarding-email.ts similarity index 96% rename from actions/send-onboarding-email.ts rename to apps/www/actions/send-onboarding-email.ts index c44a928e..51c6a4c7 100644 --- a/actions/send-onboarding-email.ts +++ b/apps/www/actions/send-onboarding-email.ts @@ -32,4 +32,4 @@ async function sendOnboardingEmail(email: string, name: string) { } } -export default sendOnboardingEmail; +export default sendOnboardingEmail; \ No newline at end of file diff --git a/actions/update-user-name.ts b/apps/www/actions/update-user-name.ts similarity index 100% rename from actions/update-user-name.ts rename to apps/www/actions/update-user-name.ts diff --git a/app/(auth)/layout.tsx b/apps/www/app/(auth)/layout.tsx similarity index 100% rename from app/(auth)/layout.tsx rename to apps/www/app/(auth)/layout.tsx diff --git a/app/(auth)/login/page.tsx b/apps/www/app/(auth)/login/page.tsx similarity index 100% rename from app/(auth)/login/page.tsx rename to apps/www/app/(auth)/login/page.tsx diff --git a/app/(auth)/register/page.tsx b/apps/www/app/(auth)/register/page.tsx similarity index 100% rename from app/(auth)/register/page.tsx rename to apps/www/app/(auth)/register/page.tsx diff --git a/app/(dashboard)/dashboard/[...id]/page.tsx b/apps/www/app/(dashboard)/dashboard/[...id]/page.tsx similarity index 100% rename from app/(dashboard)/dashboard/[...id]/page.tsx rename to apps/www/app/(dashboard)/dashboard/[...id]/page.tsx diff --git a/app/(dashboard)/dashboard/accounts/page.tsx b/apps/www/app/(dashboard)/dashboard/accounts/page.tsx similarity index 100% rename from app/(dashboard)/dashboard/accounts/page.tsx rename to apps/www/app/(dashboard)/dashboard/accounts/page.tsx diff --git a/app/(dashboard)/dashboard/categories/page.tsx b/apps/www/app/(dashboard)/dashboard/categories/page.tsx similarity index 100% rename from app/(dashboard)/dashboard/categories/page.tsx rename to apps/www/app/(dashboard)/dashboard/categories/page.tsx diff --git a/app/(dashboard)/dashboard/investments/page.tsx b/apps/www/app/(dashboard)/dashboard/investments/page.tsx similarity index 100% rename from app/(dashboard)/dashboard/investments/page.tsx rename to apps/www/app/(dashboard)/dashboard/investments/page.tsx diff --git a/app/(dashboard)/dashboard/layout.tsx b/apps/www/app/(dashboard)/dashboard/layout.tsx similarity index 100% rename from app/(dashboard)/dashboard/layout.tsx rename to apps/www/app/(dashboard)/dashboard/layout.tsx diff --git a/app/(dashboard)/dashboard/page.tsx b/apps/www/app/(dashboard)/dashboard/page.tsx similarity index 100% rename from app/(dashboard)/dashboard/page.tsx rename to apps/www/app/(dashboard)/dashboard/page.tsx diff --git a/app/(dashboard)/dashboard/recurring/page.tsx b/apps/www/app/(dashboard)/dashboard/recurring/page.tsx similarity index 94% rename from app/(dashboard)/dashboard/recurring/page.tsx rename to apps/www/app/(dashboard)/dashboard/recurring/page.tsx index 8ab8b827..44c45c6e 100644 --- a/app/(dashboard)/dashboard/recurring/page.tsx +++ b/apps/www/app/(dashboard)/dashboard/recurring/page.tsx @@ -7,7 +7,7 @@ import { getCurrentUser } from "@/lib/session"; import { isValidJSONString } from "@/lib/utils"; import { CategoriesDashboard } from "@/components/categories/components/categories-dashboard"; import { accounts, mails } from "@/components/investments/data"; -import { RecurringDashboard } from "@/components/recurring/components/recurring-dashboard"; +import { RecurringDashboard } from "@/components/transactions/components/recurring-dashboard"; export const metadata = { title: "Transactions", diff --git a/app/(dashboard)/dashboard/settings/account/account-form.tsx b/apps/www/app/(dashboard)/dashboard/settings/account/account-form.tsx similarity index 100% rename from app/(dashboard)/dashboard/settings/account/account-form.tsx rename to apps/www/app/(dashboard)/dashboard/settings/account/account-form.tsx diff --git a/app/(dashboard)/dashboard/settings/account/page.tsx b/apps/www/app/(dashboard)/dashboard/settings/account/page.tsx similarity index 100% rename from app/(dashboard)/dashboard/settings/account/page.tsx rename to apps/www/app/(dashboard)/dashboard/settings/account/page.tsx diff --git a/app/(dashboard)/dashboard/settings/appearance/appearance-form.tsx b/apps/www/app/(dashboard)/dashboard/settings/appearance/appearance-form.tsx similarity index 100% rename from app/(dashboard)/dashboard/settings/appearance/appearance-form.tsx rename to apps/www/app/(dashboard)/dashboard/settings/appearance/appearance-form.tsx diff --git a/app/(dashboard)/dashboard/settings/appearance/page.tsx b/apps/www/app/(dashboard)/dashboard/settings/appearance/page.tsx similarity index 100% rename from app/(dashboard)/dashboard/settings/appearance/page.tsx rename to apps/www/app/(dashboard)/dashboard/settings/appearance/page.tsx diff --git a/app/(dashboard)/dashboard/settings/bank-account/bank-account-form.tsx b/apps/www/app/(dashboard)/dashboard/settings/bank-account/bank-account-form.tsx similarity index 100% rename from app/(dashboard)/dashboard/settings/bank-account/bank-account-form.tsx rename to apps/www/app/(dashboard)/dashboard/settings/bank-account/bank-account-form.tsx diff --git a/app/(dashboard)/dashboard/settings/bank-account/page.tsx b/apps/www/app/(dashboard)/dashboard/settings/bank-account/page.tsx similarity index 100% rename from app/(dashboard)/dashboard/settings/bank-account/page.tsx rename to apps/www/app/(dashboard)/dashboard/settings/bank-account/page.tsx diff --git a/app/(dashboard)/dashboard/settings/display/display-form.tsx b/apps/www/app/(dashboard)/dashboard/settings/display/display-form.tsx similarity index 100% rename from app/(dashboard)/dashboard/settings/display/display-form.tsx rename to apps/www/app/(dashboard)/dashboard/settings/display/display-form.tsx diff --git a/app/(dashboard)/dashboard/settings/display/page.tsx b/apps/www/app/(dashboard)/dashboard/settings/display/page.tsx similarity index 100% rename from app/(dashboard)/dashboard/settings/display/page.tsx rename to apps/www/app/(dashboard)/dashboard/settings/display/page.tsx diff --git a/app/(dashboard)/dashboard/settings/layout.tsx b/apps/www/app/(dashboard)/dashboard/settings/layout.tsx similarity index 100% rename from app/(dashboard)/dashboard/settings/layout.tsx rename to apps/www/app/(dashboard)/dashboard/settings/layout.tsx diff --git a/app/(dashboard)/dashboard/settings/notifications/notifications-form.tsx b/apps/www/app/(dashboard)/dashboard/settings/notifications/notifications-form.tsx similarity index 100% rename from app/(dashboard)/dashboard/settings/notifications/notifications-form.tsx rename to apps/www/app/(dashboard)/dashboard/settings/notifications/notifications-form.tsx diff --git a/app/(dashboard)/dashboard/settings/notifications/page.tsx b/apps/www/app/(dashboard)/dashboard/settings/notifications/page.tsx similarity index 100% rename from app/(dashboard)/dashboard/settings/notifications/page.tsx rename to apps/www/app/(dashboard)/dashboard/settings/notifications/page.tsx diff --git a/app/(dashboard)/dashboard/settings/page.tsx b/apps/www/app/(dashboard)/dashboard/settings/page.tsx similarity index 100% rename from app/(dashboard)/dashboard/settings/page.tsx rename to apps/www/app/(dashboard)/dashboard/settings/page.tsx diff --git a/app/(dashboard)/dashboard/settings/profile-form.tsx b/apps/www/app/(dashboard)/dashboard/settings/profile-form.tsx similarity index 100% rename from app/(dashboard)/dashboard/settings/profile-form.tsx rename to apps/www/app/(dashboard)/dashboard/settings/profile-form.tsx diff --git a/app/(dashboard)/dashboard/transactions/page.tsx b/apps/www/app/(dashboard)/dashboard/transactions/page.tsx similarity index 100% rename from app/(dashboard)/dashboard/transactions/page.tsx rename to apps/www/app/(dashboard)/dashboard/transactions/page.tsx diff --git a/app/(dashboard2)/dashboard2/[...id]/page.tsx b/apps/www/app/(dashboard2)/dashboard2/[...id]/page.tsx similarity index 100% rename from app/(dashboard2)/dashboard2/[...id]/page.tsx rename to apps/www/app/(dashboard2)/dashboard2/[...id]/page.tsx diff --git a/app/(dashboard2)/dashboard2/billing/loading.tsx b/apps/www/app/(dashboard2)/dashboard2/billing/loading.tsx similarity index 100% rename from app/(dashboard2)/dashboard2/billing/loading.tsx rename to apps/www/app/(dashboard2)/dashboard2/billing/loading.tsx diff --git a/app/(dashboard2)/dashboard2/billing/page.tsx b/apps/www/app/(dashboard2)/dashboard2/billing/page.tsx similarity index 100% rename from app/(dashboard2)/dashboard2/billing/page.tsx rename to apps/www/app/(dashboard2)/dashboard2/billing/page.tsx diff --git a/app/(dashboard2)/dashboard2/layout.tsx b/apps/www/app/(dashboard2)/dashboard2/layout.tsx similarity index 100% rename from app/(dashboard2)/dashboard2/layout.tsx rename to apps/www/app/(dashboard2)/dashboard2/layout.tsx diff --git a/app/(dashboard2)/dashboard2/loading.tsx b/apps/www/app/(dashboard2)/dashboard2/loading.tsx similarity index 100% rename from app/(dashboard2)/dashboard2/loading.tsx rename to apps/www/app/(dashboard2)/dashboard2/loading.tsx diff --git a/app/(dashboard2)/dashboard2/page.tsx b/apps/www/app/(dashboard2)/dashboard2/page.tsx similarity index 100% rename from app/(dashboard2)/dashboard2/page.tsx rename to apps/www/app/(dashboard2)/dashboard2/page.tsx diff --git a/app/(dashboard2)/dashboard2/settings/loading.tsx b/apps/www/app/(dashboard2)/dashboard2/settings/loading.tsx similarity index 100% rename from app/(dashboard2)/dashboard2/settings/loading.tsx rename to apps/www/app/(dashboard2)/dashboard2/settings/loading.tsx diff --git a/app/(dashboard2)/dashboard2/settings/page.tsx b/apps/www/app/(dashboard2)/dashboard2/settings/page.tsx similarity index 100% rename from app/(dashboard2)/dashboard2/settings/page.tsx rename to apps/www/app/(dashboard2)/dashboard2/settings/page.tsx diff --git a/app/(docs)/docs/[[...slug]]/page.tsx b/apps/www/app/(docs)/docs/[[...slug]]/page.tsx similarity index 100% rename from app/(docs)/docs/[[...slug]]/page.tsx rename to apps/www/app/(docs)/docs/[[...slug]]/page.tsx diff --git a/app/(docs)/docs/layout.tsx b/apps/www/app/(docs)/docs/layout.tsx similarity index 100% rename from app/(docs)/docs/layout.tsx rename to apps/www/app/(docs)/docs/layout.tsx diff --git a/app/(docs)/guides/[...slug]/page.tsx b/apps/www/app/(docs)/guides/[...slug]/page.tsx similarity index 100% rename from app/(docs)/guides/[...slug]/page.tsx rename to apps/www/app/(docs)/guides/[...slug]/page.tsx diff --git a/app/(docs)/guides/layout.tsx b/apps/www/app/(docs)/guides/layout.tsx similarity index 100% rename from app/(docs)/guides/layout.tsx rename to apps/www/app/(docs)/guides/layout.tsx diff --git a/app/(docs)/guides/page.tsx b/apps/www/app/(docs)/guides/page.tsx similarity index 100% rename from app/(docs)/guides/page.tsx rename to apps/www/app/(docs)/guides/page.tsx diff --git a/app/(docs)/layout.tsx b/apps/www/app/(docs)/layout.tsx similarity index 100% rename from app/(docs)/layout.tsx rename to apps/www/app/(docs)/layout.tsx diff --git a/app/(marketing)/[...slug]/page.tsx b/apps/www/app/(marketing)/[...slug]/page.tsx similarity index 100% rename from app/(marketing)/[...slug]/page.tsx rename to apps/www/app/(marketing)/[...slug]/page.tsx diff --git a/app/(marketing)/blog/[...slug]/page.tsx b/apps/www/app/(marketing)/blog/[...slug]/page.tsx similarity index 100% rename from app/(marketing)/blog/[...slug]/page.tsx rename to apps/www/app/(marketing)/blog/[...slug]/page.tsx diff --git a/app/(marketing)/blog/page.tsx b/apps/www/app/(marketing)/blog/page.tsx similarity index 100% rename from app/(marketing)/blog/page.tsx rename to apps/www/app/(marketing)/blog/page.tsx diff --git a/app/(marketing)/error.tsx b/apps/www/app/(marketing)/error.tsx similarity index 100% rename from app/(marketing)/error.tsx rename to apps/www/app/(marketing)/error.tsx diff --git a/app/(marketing)/layout.tsx b/apps/www/app/(marketing)/layout.tsx similarity index 100% rename from app/(marketing)/layout.tsx rename to apps/www/app/(marketing)/layout.tsx diff --git a/app/(marketing)/oss-friends/page.tsx b/apps/www/app/(marketing)/oss-friends/page.tsx similarity index 100% rename from app/(marketing)/oss-friends/page.tsx rename to apps/www/app/(marketing)/oss-friends/page.tsx diff --git a/app/(marketing)/page.tsx b/apps/www/app/(marketing)/page.tsx similarity index 100% rename from app/(marketing)/page.tsx rename to apps/www/app/(marketing)/page.tsx diff --git a/app/(marketing)/pricing/loading.tsx b/apps/www/app/(marketing)/pricing/loading.tsx similarity index 100% rename from app/(marketing)/pricing/loading.tsx rename to apps/www/app/(marketing)/pricing/loading.tsx diff --git a/app/(marketing)/pricing/page.tsx b/apps/www/app/(marketing)/pricing/page.tsx similarity index 100% rename from app/(marketing)/pricing/page.tsx rename to apps/www/app/(marketing)/pricing/page.tsx diff --git a/app/api/ai/analyzeImage/route.ts b/apps/www/app/api/ai/analyzeImage/route.ts similarity index 100% rename from app/api/ai/analyzeImage/route.ts rename to apps/www/app/api/ai/analyzeImage/route.ts diff --git a/apps/www/app/api/ai/generateDescription/route.ts b/apps/www/app/api/ai/generateDescription/route.ts new file mode 100644 index 00000000..dd1c0980 --- /dev/null +++ b/apps/www/app/api/ai/generateDescription/route.ts @@ -0,0 +1,47 @@ +// app/api/ai/generateDescription/route.ts +import { NextRequest, NextResponse } from "next/server"; +import axios from "axios"; + +export async function POST(request: NextRequest) { + const requestBody = await request.json(); + const { allResponses, text } = requestBody; + + // Construct messages for the chat completion request + const messages = allResponses.map(response => { + return { + role: "user", + content: `Options: ${response.options.join(", ")}.` + }; + }); + + console.log(messages); + + // Add the specific request text + messages.push({ role: "system", content: "I need you to act like a real estate agent and write a description for this house. I need a title and a description" }); + messages.push({ role: "user", content: text }); + + try { + const openaiResponse = await axios.post( + "https://api.openai.com/v1/chat/completions", + { + model: "gpt-4", + messages: messages + }, + { + headers: { + 'Authorization': `Bearer ${process.env.OPENAI_API_KEY}`, + 'Content-Type': 'application/json' + } + } + ); + + // Extracting the assistant's response + const completion = openaiResponse.data.choices[0].message.content; + + // Send the assistant's response back to the client + return NextResponse.json({ description: completion }); + } catch (error) { + console.error("Error in generating description:", error); + return NextResponse.json({ error: "Failed to generate description" }, { status: 500 }); + } +} diff --git a/app/api/auth/[...nextauth]/route.ts b/apps/www/app/api/auth/[...nextauth]/route.ts similarity index 100% rename from app/api/auth/[...nextauth]/route.ts rename to apps/www/app/api/auth/[...nextauth]/route.ts diff --git a/app/api/edgestore/[...edgestore]/route.ts b/apps/www/app/api/edgestore/[...edgestore]/route.ts similarity index 100% rename from app/api/edgestore/[...edgestore]/route.ts rename to apps/www/app/api/edgestore/[...edgestore]/route.ts diff --git a/app/api/og/route.tsx b/apps/www/app/api/og/route.tsx similarity index 100% rename from app/api/og/route.tsx rename to apps/www/app/api/og/route.tsx diff --git a/app/api/webhooks/stripe/route.ts b/apps/www/app/api/webhooks/stripe/route.ts similarity index 100% rename from app/api/webhooks/stripe/route.ts rename to apps/www/app/api/webhooks/stripe/route.ts diff --git a/app/layout.tsx b/apps/www/app/layout.tsx similarity index 100% rename from app/layout.tsx rename to apps/www/app/layout.tsx diff --git a/assets/opengraph-image.jpg b/apps/www/app/opengraph-image.jpg similarity index 100% rename from assets/opengraph-image.jpg rename to apps/www/app/opengraph-image.jpg diff --git a/app/opengraph-image.tsx b/apps/www/app/opengraph-image.tsx similarity index 100% rename from app/opengraph-image.tsx rename to apps/www/app/opengraph-image.tsx diff --git a/app/robots.ts b/apps/www/app/robots.ts similarity index 100% rename from app/robots.ts rename to apps/www/app/robots.ts diff --git a/app/sitemap.ts b/apps/www/app/sitemap.ts similarity index 100% rename from app/sitemap.ts rename to apps/www/app/sitemap.ts diff --git a/assets/fonts/CalSans-SemiBold.ttf b/apps/www/assets/fonts/CalSans-SemiBold.ttf similarity index 100% rename from assets/fonts/CalSans-SemiBold.ttf rename to apps/www/assets/fonts/CalSans-SemiBold.ttf diff --git a/assets/fonts/CalSans-SemiBold.woff2 b/apps/www/assets/fonts/CalSans-SemiBold.woff2 similarity index 100% rename from assets/fonts/CalSans-SemiBold.woff2 rename to apps/www/assets/fonts/CalSans-SemiBold.woff2 diff --git a/assets/fonts/Inter-Bold.ttf b/apps/www/assets/fonts/Inter-Bold.ttf similarity index 100% rename from assets/fonts/Inter-Bold.ttf rename to apps/www/assets/fonts/Inter-Bold.ttf diff --git a/assets/fonts/Inter-Regular.ttf b/apps/www/assets/fonts/Inter-Regular.ttf similarity index 100% rename from assets/fonts/Inter-Regular.ttf rename to apps/www/assets/fonts/Inter-Regular.ttf diff --git a/assets/fonts/index.ts b/apps/www/assets/fonts/index.ts similarity index 100% rename from assets/fonts/index.ts rename to apps/www/assets/fonts/index.ts diff --git a/public/og.jpg b/apps/www/assets/opengraph-image.jpg similarity index 100% rename from public/og.jpg rename to apps/www/assets/opengraph-image.jpg diff --git a/components/accounts/components/account-switcher.tsx b/apps/www/components/accounts/components/account-switcher.tsx similarity index 100% rename from components/accounts/components/account-switcher.tsx rename to apps/www/components/accounts/components/account-switcher.tsx diff --git a/components/accounts/components/accounts-dashboard.tsx b/apps/www/components/accounts/components/accounts-dashboard.tsx similarity index 100% rename from components/accounts/components/accounts-dashboard.tsx rename to apps/www/components/accounts/components/accounts-dashboard.tsx diff --git a/components/accounts/components/accounts-display.tsx b/apps/www/components/accounts/components/accounts-display.tsx similarity index 100% rename from components/accounts/components/accounts-display.tsx rename to apps/www/components/accounts/components/accounts-display.tsx diff --git a/components/accounts/components/accounts-list.tsx b/apps/www/components/accounts/components/accounts-list.tsx similarity index 100% rename from components/accounts/components/accounts-list.tsx rename to apps/www/components/accounts/components/accounts-list.tsx diff --git a/components/accounts/components/accounts-review-table.tsx b/apps/www/components/accounts/components/accounts-review-table.tsx similarity index 100% rename from components/accounts/components/accounts-review-table.tsx rename to apps/www/components/accounts/components/accounts-review-table.tsx diff --git a/components/accounts/components/nav.tsx b/apps/www/components/accounts/components/nav.tsx similarity index 100% rename from components/accounts/components/nav.tsx rename to apps/www/components/accounts/components/nav.tsx diff --git a/components/accounts/data.tsx b/apps/www/components/accounts/data.tsx similarity index 100% rename from components/accounts/data.tsx rename to apps/www/components/accounts/data.tsx diff --git a/components/accounts/use-mail.ts b/apps/www/components/accounts/use-mail.ts similarity index 100% rename from components/accounts/use-mail.ts rename to apps/www/components/accounts/use-mail.ts diff --git a/components/analytics.tsx b/apps/www/components/analytics.tsx similarity index 100% rename from components/analytics.tsx rename to apps/www/components/analytics.tsx diff --git a/components/billing-info.tsx b/apps/www/components/billing-info.tsx similarity index 100% rename from components/billing-info.tsx rename to apps/www/components/billing-info.tsx diff --git a/components/blog-posts.tsx b/apps/www/components/blog-posts.tsx similarity index 100% rename from components/blog-posts.tsx rename to apps/www/components/blog-posts.tsx diff --git a/apps/www/components/buttons/AddFilesButton.tsx b/apps/www/components/buttons/AddFilesButton.tsx new file mode 100644 index 00000000..205fb1e7 --- /dev/null +++ b/apps/www/components/buttons/AddFilesButton.tsx @@ -0,0 +1,32 @@ +import { Button } from "@/components/ui/button" +import { + Dialog, + DialogContent, + DialogDescription, + DialogHeader, + DialogTitle, + DialogTrigger, +} from "@/components/ui/dialog" +import { UploadDropZone } from "../fileupload/UploadDropZone" + +export function AddFilesButton({propertyId, slug}) { + + return ( + + + + + + + Upload your files + + Upload all your photos for your property + + +
+ +
+
+
+ ) +} diff --git a/components/buttons/GetStartedButton.tsx b/apps/www/components/buttons/GetStartedButton.tsx similarity index 100% rename from components/buttons/GetStartedButton.tsx rename to apps/www/components/buttons/GetStartedButton.tsx diff --git a/components/buttons/LanguageButton.tsx b/apps/www/components/buttons/LanguageButton.tsx similarity index 100% rename from components/buttons/LanguageButton.tsx rename to apps/www/components/buttons/LanguageButton.tsx diff --git a/components/buttons/SubmitProperty.tsx b/apps/www/components/buttons/SubmitProperty.tsx similarity index 100% rename from components/buttons/SubmitProperty.tsx rename to apps/www/components/buttons/SubmitProperty.tsx diff --git a/components/categories/components/account-switcher.tsx b/apps/www/components/categories/components/account-switcher.tsx similarity index 100% rename from components/categories/components/account-switcher.tsx rename to apps/www/components/categories/components/account-switcher.tsx diff --git a/components/categories/components/accounts-list.tsx b/apps/www/components/categories/components/accounts-list.tsx similarity index 100% rename from components/categories/components/accounts-list.tsx rename to apps/www/components/categories/components/accounts-list.tsx diff --git a/components/categories/components/accounts-review-table.tsx b/apps/www/components/categories/components/accounts-review-table.tsx similarity index 100% rename from components/categories/components/accounts-review-table.tsx rename to apps/www/components/categories/components/accounts-review-table.tsx diff --git a/components/categories/components/allocation-section.tsx b/apps/www/components/categories/components/allocation-section.tsx similarity index 100% rename from components/categories/components/allocation-section.tsx rename to apps/www/components/categories/components/allocation-section.tsx diff --git a/components/categories/components/allocation-table.tsx b/apps/www/components/categories/components/allocation-table.tsx similarity index 100% rename from components/categories/components/allocation-table.tsx rename to apps/www/components/categories/components/allocation-table.tsx diff --git a/components/categories/components/categories-dashboard.tsx b/apps/www/components/categories/components/categories-dashboard.tsx similarity index 100% rename from components/categories/components/categories-dashboard.tsx rename to apps/www/components/categories/components/categories-dashboard.tsx diff --git a/components/categories/components/categories-display.tsx b/apps/www/components/categories/components/categories-display.tsx similarity index 100% rename from components/categories/components/categories-display.tsx rename to apps/www/components/categories/components/categories-display.tsx diff --git a/components/categories/components/holdings-table.tsx b/apps/www/components/categories/components/holdings-table.tsx similarity index 100% rename from components/categories/components/holdings-table.tsx rename to apps/www/components/categories/components/holdings-table.tsx diff --git a/components/categories/components/investment-cards.tsx b/apps/www/components/categories/components/investment-cards.tsx similarity index 100% rename from components/categories/components/investment-cards.tsx rename to apps/www/components/categories/components/investment-cards.tsx diff --git a/components/categories/components/key-metrics-table.tsx b/apps/www/components/categories/components/key-metrics-table.tsx similarity index 100% rename from components/categories/components/key-metrics-table.tsx rename to apps/www/components/categories/components/key-metrics-table.tsx diff --git a/components/categories/components/nav.tsx b/apps/www/components/categories/components/nav.tsx similarity index 100% rename from components/categories/components/nav.tsx rename to apps/www/components/categories/components/nav.tsx diff --git a/components/categories/components/small-investment-card.tsx b/apps/www/components/categories/components/small-investment-card.tsx similarity index 100% rename from components/categories/components/small-investment-card.tsx rename to apps/www/components/categories/components/small-investment-card.tsx diff --git a/components/categories/components/total-balance-card.tsx b/apps/www/components/categories/components/total-balance-card.tsx similarity index 100% rename from components/categories/components/total-balance-card.tsx rename to apps/www/components/categories/components/total-balance-card.tsx diff --git a/components/categories/data.tsx b/apps/www/components/categories/data.tsx similarity index 100% rename from components/categories/data.tsx rename to apps/www/components/categories/data.tsx diff --git a/components/categories/use-mail.ts b/apps/www/components/categories/use-mail.ts similarity index 100% rename from components/categories/use-mail.ts rename to apps/www/components/categories/use-mail.ts diff --git a/components/content/mdx-card.tsx b/apps/www/components/content/mdx-card.tsx similarity index 100% rename from components/content/mdx-card.tsx rename to apps/www/components/content/mdx-card.tsx diff --git a/components/content/mdx-components.tsx b/apps/www/components/content/mdx-components.tsx similarity index 100% rename from components/content/mdx-components.tsx rename to apps/www/components/content/mdx-components.tsx diff --git a/components/content/templete-blog/deploying-next-apps.mdx b/apps/www/components/content/templete-blog/deploying-next-apps.mdx similarity index 100% rename from components/content/templete-blog/deploying-next-apps.mdx rename to apps/www/components/content/templete-blog/deploying-next-apps.mdx diff --git a/components/content/templete-blog/dynamic-routing-static-regeneration copy.mdx b/apps/www/components/content/templete-blog/dynamic-routing-static-regeneration copy.mdx similarity index 100% rename from components/content/templete-blog/dynamic-routing-static-regeneration copy.mdx rename to apps/www/components/content/templete-blog/dynamic-routing-static-regeneration copy.mdx diff --git a/components/content/templete-blog/preview-mode-headless-cms.mdx b/apps/www/components/content/templete-blog/preview-mode-headless-cms.mdx similarity index 100% rename from components/content/templete-blog/preview-mode-headless-cms.mdx rename to apps/www/components/content/templete-blog/preview-mode-headless-cms.mdx diff --git a/components/content/templete-blog/server-client-components.mdx b/apps/www/components/content/templete-blog/server-client-components.mdx similarity index 100% rename from components/content/templete-blog/server-client-components.mdx rename to apps/www/components/content/templete-blog/server-client-components.mdx diff --git a/components/dashboard/businessline.tsx b/apps/www/components/dashboard/businessline.tsx similarity index 100% rename from components/dashboard/businessline.tsx rename to apps/www/components/dashboard/businessline.tsx diff --git a/components/dashboard/calltoaction.tsx b/apps/www/components/dashboard/calltoaction.tsx similarity index 100% rename from components/dashboard/calltoaction.tsx rename to apps/www/components/dashboard/calltoaction.tsx diff --git a/components/dashboard/descriptiondisplay.tsx b/apps/www/components/dashboard/descriptiondisplay.tsx similarity index 100% rename from components/dashboard/descriptiondisplay.tsx rename to apps/www/components/dashboard/descriptiondisplay.tsx diff --git a/components/dashboard/featuresection1.tsx b/apps/www/components/dashboard/featuresection1.tsx similarity index 100% rename from components/dashboard/featuresection1.tsx rename to apps/www/components/dashboard/featuresection1.tsx diff --git a/components/dashboard/feautressection.tsx b/apps/www/components/dashboard/feautressection.tsx similarity index 100% rename from components/dashboard/feautressection.tsx rename to apps/www/components/dashboard/feautressection.tsx diff --git a/components/dashboard/generatedtext.tsx b/apps/www/components/dashboard/generatedtext.tsx similarity index 100% rename from components/dashboard/generatedtext.tsx rename to apps/www/components/dashboard/generatedtext.tsx diff --git a/components/dashboard/header.tsx b/apps/www/components/dashboard/header.tsx similarity index 100% rename from components/dashboard/header.tsx rename to apps/www/components/dashboard/header.tsx diff --git a/components/dashboard/shell.tsx b/apps/www/components/dashboard/shell.tsx similarity index 100% rename from components/dashboard/shell.tsx rename to apps/www/components/dashboard/shell.tsx diff --git a/components/dashboard/test.tsx b/apps/www/components/dashboard/test.tsx similarity index 100% rename from components/dashboard/test.tsx rename to apps/www/components/dashboard/test.tsx diff --git a/components/docs/page-header.tsx b/apps/www/components/docs/page-header.tsx similarity index 100% rename from components/docs/page-header.tsx rename to apps/www/components/docs/page-header.tsx diff --git a/components/docs/pager.tsx b/apps/www/components/docs/pager.tsx similarity index 100% rename from components/docs/pager.tsx rename to apps/www/components/docs/pager.tsx diff --git a/components/docs/search.tsx b/apps/www/components/docs/search.tsx similarity index 100% rename from components/docs/search.tsx rename to apps/www/components/docs/search.tsx diff --git a/components/docs/sidebar-nav.tsx b/apps/www/components/docs/sidebar-nav.tsx similarity index 100% rename from components/docs/sidebar-nav.tsx rename to apps/www/components/docs/sidebar-nav.tsx diff --git a/components/fileupload/MultiFileDropzone.tsx b/apps/www/components/fileupload/MultiFileDropzone.tsx similarity index 100% rename from components/fileupload/MultiFileDropzone.tsx rename to apps/www/components/fileupload/MultiFileDropzone.tsx diff --git a/components/fileupload/UploadDropZone.tsx b/apps/www/components/fileupload/UploadDropZone.tsx similarity index 100% rename from components/fileupload/UploadDropZone.tsx rename to apps/www/components/fileupload/UploadDropZone.tsx diff --git a/components/forms/billing-form-button.tsx b/apps/www/components/forms/billing-form-button.tsx similarity index 100% rename from components/forms/billing-form-button.tsx rename to apps/www/components/forms/billing-form-button.tsx diff --git a/components/forms/select-input-form.tsx b/apps/www/components/forms/select-input-form.tsx similarity index 100% rename from components/forms/select-input-form.tsx rename to apps/www/components/forms/select-input-form.tsx diff --git a/components/forms/update-property-form.tsx b/apps/www/components/forms/update-property-form.tsx similarity index 100% rename from components/forms/update-property-form.tsx rename to apps/www/components/forms/update-property-form.tsx diff --git a/components/forms/user-auth-form.tsx b/apps/www/components/forms/user-auth-form.tsx similarity index 100% rename from components/forms/user-auth-form.tsx rename to apps/www/components/forms/user-auth-form.tsx diff --git a/components/forms/user-name-form.tsx b/apps/www/components/forms/user-name-form.tsx similarity index 100% rename from components/forms/user-name-form.tsx rename to apps/www/components/forms/user-name-form.tsx diff --git a/components/transactions/components/account-switcher.tsx b/apps/www/components/investments/components/account-switcher.tsx similarity index 99% rename from components/transactions/components/account-switcher.tsx rename to apps/www/components/investments/components/account-switcher.tsx index 142caf08..e6ced5a9 100644 --- a/components/transactions/components/account-switcher.tsx +++ b/apps/www/components/investments/components/account-switcher.tsx @@ -60,4 +60,4 @@ export function AccountSwitcher({ ); -} +} \ No newline at end of file diff --git a/components/investments/components/accounts-display.tsx b/apps/www/components/investments/components/accounts-display.tsx similarity index 99% rename from components/investments/components/accounts-display.tsx rename to apps/www/components/investments/components/accounts-display.tsx index d4488bf3..ad6e8a15 100644 --- a/components/investments/components/accounts-display.tsx +++ b/apps/www/components/investments/components/accounts-display.tsx @@ -48,7 +48,7 @@ import { TransactionsReviewTable } from "@/components/new-dashboard/components/t import { Mail } from "../data"; import { AccountsReviewTable } from "./accounts-review-table"; -import { PositionsTable } from "./positions-table"; +import { PositionsTable } from "@/components/transactions/components/positions-table"; interface MailDisplayProps { mail: Mail | null; diff --git a/components/investments/components/accounts-list.tsx b/apps/www/components/investments/components/accounts-list.tsx similarity index 100% rename from components/investments/components/accounts-list.tsx rename to apps/www/components/investments/components/accounts-list.tsx diff --git a/components/investments/components/accounts-review-table.tsx b/apps/www/components/investments/components/accounts-review-table.tsx similarity index 100% rename from components/investments/components/accounts-review-table.tsx rename to apps/www/components/investments/components/accounts-review-table.tsx diff --git a/components/investments/components/allocation-section.tsx b/apps/www/components/investments/components/allocation-section.tsx similarity index 100% rename from components/investments/components/allocation-section.tsx rename to apps/www/components/investments/components/allocation-section.tsx diff --git a/components/investments/components/allocation-table.tsx b/apps/www/components/investments/components/allocation-table.tsx similarity index 100% rename from components/investments/components/allocation-table.tsx rename to apps/www/components/investments/components/allocation-table.tsx diff --git a/components/investments/components/holdings-table.tsx b/apps/www/components/investments/components/holdings-table.tsx similarity index 100% rename from components/investments/components/holdings-table.tsx rename to apps/www/components/investments/components/holdings-table.tsx diff --git a/components/investments/components/investment-cards.tsx b/apps/www/components/investments/components/investment-cards.tsx similarity index 100% rename from components/investments/components/investment-cards.tsx rename to apps/www/components/investments/components/investment-cards.tsx diff --git a/components/investments/components/investment-dashboard.tsx b/apps/www/components/investments/components/investment-dashboard.tsx similarity index 100% rename from components/investments/components/investment-dashboard.tsx rename to apps/www/components/investments/components/investment-dashboard.tsx diff --git a/components/investments/components/nav.tsx b/apps/www/components/investments/components/nav.tsx similarity index 100% rename from components/investments/components/nav.tsx rename to apps/www/components/investments/components/nav.tsx diff --git a/components/investments/components/small-investment-card.tsx b/apps/www/components/investments/components/small-investment-card.tsx similarity index 100% rename from components/investments/components/small-investment-card.tsx rename to apps/www/components/investments/components/small-investment-card.tsx diff --git a/components/investments/components/total-balance-card.tsx b/apps/www/components/investments/components/total-balance-card.tsx similarity index 100% rename from components/investments/components/total-balance-card.tsx rename to apps/www/components/investments/components/total-balance-card.tsx diff --git a/components/investments/data.tsx b/apps/www/components/investments/data.tsx similarity index 100% rename from components/investments/data.tsx rename to apps/www/components/investments/data.tsx diff --git a/components/investments/use-mail.ts b/apps/www/components/investments/use-mail.ts similarity index 100% rename from components/investments/use-mail.ts rename to apps/www/components/investments/use-mail.ts diff --git a/components/layout/language-modal.tsx b/apps/www/components/layout/language-modal.tsx similarity index 100% rename from components/layout/language-modal.tsx rename to apps/www/components/layout/language-modal.tsx diff --git a/components/layout/main-nav.tsx b/apps/www/components/layout/main-nav.tsx similarity index 100% rename from components/layout/main-nav.tsx rename to apps/www/components/layout/main-nav.tsx diff --git a/components/layout/mobile-nav.tsx b/apps/www/components/layout/mobile-nav.tsx similarity index 100% rename from components/layout/mobile-nav.tsx rename to apps/www/components/layout/mobile-nav.tsx diff --git a/components/layout/mode-toggle.tsx b/apps/www/components/layout/mode-toggle.tsx similarity index 100% rename from components/layout/mode-toggle.tsx rename to apps/www/components/layout/mode-toggle.tsx diff --git a/components/layout/nav.tsx b/apps/www/components/layout/nav.tsx similarity index 100% rename from components/layout/nav.tsx rename to apps/www/components/layout/nav.tsx diff --git a/components/layout/navbar.tsx b/apps/www/components/layout/navbar.tsx similarity index 100% rename from components/layout/navbar.tsx rename to apps/www/components/layout/navbar.tsx diff --git a/components/layout/settings-sidebar-nav.tsx b/apps/www/components/layout/settings-sidebar-nav.tsx similarity index 100% rename from components/layout/settings-sidebar-nav.tsx rename to apps/www/components/layout/settings-sidebar-nav.tsx diff --git a/components/layout/sign-in-modal.tsx b/apps/www/components/layout/sign-in-modal.tsx similarity index 100% rename from components/layout/sign-in-modal.tsx rename to apps/www/components/layout/sign-in-modal.tsx diff --git a/components/layout/site-footer.tsx b/apps/www/components/layout/site-footer.tsx similarity index 100% rename from components/layout/site-footer.tsx rename to apps/www/components/layout/site-footer.tsx diff --git a/components/layout/user-account-nav.tsx b/apps/www/components/layout/user-account-nav.tsx similarity index 100% rename from components/layout/user-account-nav.tsx rename to apps/www/components/layout/user-account-nav.tsx diff --git a/components/modal-provider.tsx b/apps/www/components/modal-provider.tsx similarity index 100% rename from components/modal-provider.tsx rename to apps/www/components/modal-provider.tsx diff --git a/components/new-dashboard/components/account-switcher.tsx b/apps/www/components/new-dashboard/components/account-switcher.tsx similarity index 100% rename from components/new-dashboard/components/account-switcher.tsx rename to apps/www/components/new-dashboard/components/account-switcher.tsx diff --git a/components/new-dashboard/components/dashboard-1.tsx b/apps/www/components/new-dashboard/components/dashboard-1.tsx similarity index 100% rename from components/new-dashboard/components/dashboard-1.tsx rename to apps/www/components/new-dashboard/components/dashboard-1.tsx diff --git a/components/new-dashboard/components/mail-display.tsx b/apps/www/components/new-dashboard/components/mail-display.tsx similarity index 100% rename from components/new-dashboard/components/mail-display.tsx rename to apps/www/components/new-dashboard/components/mail-display.tsx diff --git a/components/new-dashboard/components/mail-list.tsx b/apps/www/components/new-dashboard/components/mail-list.tsx similarity index 100% rename from components/new-dashboard/components/mail-list.tsx rename to apps/www/components/new-dashboard/components/mail-list.tsx diff --git a/components/new-dashboard/components/nav.tsx b/apps/www/components/new-dashboard/components/nav.tsx similarity index 100% rename from components/new-dashboard/components/nav.tsx rename to apps/www/components/new-dashboard/components/nav.tsx diff --git a/components/new-dashboard/components/stats.tsx b/apps/www/components/new-dashboard/components/stats.tsx similarity index 100% rename from components/new-dashboard/components/stats.tsx rename to apps/www/components/new-dashboard/components/stats.tsx diff --git a/components/new-dashboard/components/top-categories-table.tsx b/apps/www/components/new-dashboard/components/top-categories-table.tsx similarity index 100% rename from components/new-dashboard/components/top-categories-table.tsx rename to apps/www/components/new-dashboard/components/top-categories-table.tsx diff --git a/components/new-dashboard/components/transaction-review-table.tsx b/apps/www/components/new-dashboard/components/transaction-review-table.tsx similarity index 100% rename from components/new-dashboard/components/transaction-review-table.tsx rename to apps/www/components/new-dashboard/components/transaction-review-table.tsx diff --git a/components/new-dashboard/data.tsx b/apps/www/components/new-dashboard/data.tsx similarity index 100% rename from components/new-dashboard/data.tsx rename to apps/www/components/new-dashboard/data.tsx diff --git a/components/new-dashboard/use-mail.ts b/apps/www/components/new-dashboard/use-mail.ts similarity index 100% rename from components/new-dashboard/use-mail.ts rename to apps/www/components/new-dashboard/use-mail.ts diff --git a/components/pricing-cards.tsx b/apps/www/components/pricing-cards.tsx similarity index 100% rename from components/pricing-cards.tsx rename to apps/www/components/pricing-cards.tsx diff --git a/components/pricing-faq.tsx b/apps/www/components/pricing-faq.tsx similarity index 100% rename from components/pricing-faq.tsx rename to apps/www/components/pricing-faq.tsx diff --git a/components/properties/NoPhotoPlaceholder copy.tsx b/apps/www/components/properties/NoPhotoPlaceholder copy.tsx similarity index 100% rename from components/properties/NoPhotoPlaceholder copy.tsx rename to apps/www/components/properties/NoPhotoPlaceholder copy.tsx diff --git a/components/properties/NoSummaryPlaceholder.tsx b/apps/www/components/properties/NoSummaryPlaceholder.tsx similarity index 100% rename from components/properties/NoSummaryPlaceholder.tsx rename to apps/www/components/properties/NoSummaryPlaceholder.tsx diff --git a/components/properties/NoTextPlaceholder.tsx b/apps/www/components/properties/NoTextPlaceholder.tsx similarity index 100% rename from components/properties/NoTextPlaceholder.tsx rename to apps/www/components/properties/NoTextPlaceholder.tsx diff --git a/components/properties/Propertiestable.tsx b/apps/www/components/properties/Propertiestable.tsx similarity index 100% rename from components/properties/Propertiestable.tsx rename to apps/www/components/properties/Propertiestable.tsx diff --git a/apps/www/components/properties/PropertyImageWithOptions.tsx b/apps/www/components/properties/PropertyImageWithOptions.tsx new file mode 100644 index 00000000..c4082e15 --- /dev/null +++ b/apps/www/components/properties/PropertyImageWithOptions.tsx @@ -0,0 +1,26 @@ +// components/properties/PropertyImageWithOptions.js +import PropertyPicture from './PropertyPicture'; +import { SelectInputForm } from '../forms/select-input-form'; + +const PropertyImageWithOptions = ({ image }) => { + console.log(image) + // Transform the image options into the correct format for SelectInputForm + const options = [ + { key: 'option1', label: 'Option 1', description: image.option1, imageId: image.id, selectedOption: image.selectedOption }, + { key: 'option2', label: 'Option 2', description: image.option2, imageId: image.id, selectedOption: image.selectedOption }, + { key: 'option3', label: 'Option 3', description: image.option3, imageId: image.id, selectedOption: image.selectedOption }, + ].filter(option => option.description); // Filter out options without a description + + return ( +
+
+ +
+
+ +
+
+ ); +}; + +export default PropertyImageWithOptions; diff --git a/components/properties/PropertyPicture.tsx b/apps/www/components/properties/PropertyPicture.tsx similarity index 100% rename from components/properties/PropertyPicture.tsx rename to apps/www/components/properties/PropertyPicture.tsx diff --git a/components/providers.tsx b/apps/www/components/providers.tsx similarity index 100% rename from components/providers.tsx rename to apps/www/components/providers.tsx diff --git a/components/investments/components/account-switcher.tsx b/apps/www/components/recurring/components/account-switcher.tsx similarity index 100% rename from components/investments/components/account-switcher.tsx rename to apps/www/components/recurring/components/account-switcher.tsx diff --git a/components/recurring/components/accounts-list.tsx b/apps/www/components/recurring/components/accounts-list.tsx similarity index 100% rename from components/recurring/components/accounts-list.tsx rename to apps/www/components/recurring/components/accounts-list.tsx diff --git a/components/recurring/components/accounts-review-table.tsx b/apps/www/components/recurring/components/accounts-review-table.tsx similarity index 100% rename from components/recurring/components/accounts-review-table.tsx rename to apps/www/components/recurring/components/accounts-review-table.tsx diff --git a/components/recurring/components/allocation-section.tsx b/apps/www/components/recurring/components/allocation-section.tsx similarity index 100% rename from components/recurring/components/allocation-section.tsx rename to apps/www/components/recurring/components/allocation-section.tsx diff --git a/components/recurring/components/allocation-table.tsx b/apps/www/components/recurring/components/allocation-table.tsx similarity index 100% rename from components/recurring/components/allocation-table.tsx rename to apps/www/components/recurring/components/allocation-table.tsx diff --git a/components/recurring/components/recurring-dashboard.tsx b/apps/www/components/recurring/components/categories-dashboard.tsx similarity index 100% rename from components/recurring/components/recurring-dashboard.tsx rename to apps/www/components/recurring/components/categories-dashboard.tsx diff --git a/components/recurring/components/categories-display.tsx b/apps/www/components/recurring/components/categories-display.tsx similarity index 100% rename from components/recurring/components/categories-display.tsx rename to apps/www/components/recurring/components/categories-display.tsx diff --git a/components/recurring/components/holdings-table.tsx b/apps/www/components/recurring/components/holdings-table.tsx similarity index 100% rename from components/recurring/components/holdings-table.tsx rename to apps/www/components/recurring/components/holdings-table.tsx diff --git a/components/recurring/components/investment-cards.tsx b/apps/www/components/recurring/components/investment-cards.tsx similarity index 100% rename from components/recurring/components/investment-cards.tsx rename to apps/www/components/recurring/components/investment-cards.tsx diff --git a/components/recurring/components/key-metrics-table.tsx b/apps/www/components/recurring/components/key-metrics-table.tsx similarity index 100% rename from components/recurring/components/key-metrics-table.tsx rename to apps/www/components/recurring/components/key-metrics-table.tsx diff --git a/components/recurring/components/nav.tsx b/apps/www/components/recurring/components/nav.tsx similarity index 100% rename from components/recurring/components/nav.tsx rename to apps/www/components/recurring/components/nav.tsx diff --git a/components/recurring/components/small-investment-card.tsx b/apps/www/components/recurring/components/small-investment-card.tsx similarity index 100% rename from components/recurring/components/small-investment-card.tsx rename to apps/www/components/recurring/components/small-investment-card.tsx diff --git a/components/recurring/components/total-balance-card.tsx b/apps/www/components/recurring/components/total-balance-card.tsx similarity index 100% rename from components/recurring/components/total-balance-card.tsx rename to apps/www/components/recurring/components/total-balance-card.tsx diff --git a/components/recurring/data.tsx b/apps/www/components/recurring/data.tsx similarity index 100% rename from components/recurring/data.tsx rename to apps/www/components/recurring/data.tsx diff --git a/components/recurring/use-mail.ts b/apps/www/components/recurring/use-mail.ts similarity index 100% rename from components/recurring/use-mail.ts rename to apps/www/components/recurring/use-mail.ts diff --git a/components/shared/askai-command.tsx b/apps/www/components/shared/askai-command.tsx similarity index 100% rename from components/shared/askai-command.tsx rename to apps/www/components/shared/askai-command.tsx diff --git a/components/shared/callout.tsx b/apps/www/components/shared/callout.tsx similarity index 100% rename from components/shared/callout.tsx rename to apps/www/components/shared/callout.tsx diff --git a/components/shared/card-skeleton.tsx b/apps/www/components/shared/card-skeleton.tsx similarity index 100% rename from components/shared/card-skeleton.tsx rename to apps/www/components/shared/card-skeleton.tsx diff --git a/components/shared/empty-placeholder.tsx b/apps/www/components/shared/empty-placeholder.tsx similarity index 100% rename from components/shared/empty-placeholder.tsx rename to apps/www/components/shared/empty-placeholder.tsx diff --git a/components/shared/icons.tsx b/apps/www/components/shared/icons.tsx similarity index 100% rename from components/shared/icons.tsx rename to apps/www/components/shared/icons.tsx diff --git a/components/shared/modal.tsx b/apps/www/components/shared/modal.tsx similarity index 100% rename from components/shared/modal.tsx rename to apps/www/components/shared/modal.tsx diff --git a/components/shared/toc.tsx b/apps/www/components/shared/toc.tsx similarity index 100% rename from components/shared/toc.tsx rename to apps/www/components/shared/toc.tsx diff --git a/components/shared/user-avatar.tsx b/apps/www/components/shared/user-avatar.tsx similarity index 100% rename from components/shared/user-avatar.tsx rename to apps/www/components/shared/user-avatar.tsx diff --git a/components/table/dashboard/columns.tsx b/apps/www/components/table/dashboard/columns.tsx similarity index 100% rename from components/table/dashboard/columns.tsx rename to apps/www/components/table/dashboard/columns.tsx diff --git a/components/table/dashboard/data-table-faceted-filter.tsx b/apps/www/components/table/dashboard/data-table-faceted-filter.tsx similarity index 100% rename from components/table/dashboard/data-table-faceted-filter.tsx rename to apps/www/components/table/dashboard/data-table-faceted-filter.tsx diff --git a/components/table/dashboard/data-table-toolbar.tsx b/apps/www/components/table/dashboard/data-table-toolbar.tsx similarity index 100% rename from components/table/dashboard/data-table-toolbar.tsx rename to apps/www/components/table/dashboard/data-table-toolbar.tsx diff --git a/components/table/dashboard/data-table-view-options.tsx b/apps/www/components/table/dashboard/data-table-view-options.tsx similarity index 100% rename from components/table/dashboard/data-table-view-options.tsx rename to apps/www/components/table/dashboard/data-table-view-options.tsx diff --git a/components/table/dashboard/data-table.tsx b/apps/www/components/table/dashboard/data-table.tsx similarity index 100% rename from components/table/dashboard/data-table.tsx rename to apps/www/components/table/dashboard/data-table.tsx diff --git a/components/table/dashboard/propertystatus.tsx b/apps/www/components/table/dashboard/propertystatus.tsx similarity index 100% rename from components/table/dashboard/propertystatus.tsx rename to apps/www/components/table/dashboard/propertystatus.tsx diff --git a/components/tailwind-indicator.tsx b/apps/www/components/tailwind-indicator.tsx similarity index 100% rename from components/tailwind-indicator.tsx rename to apps/www/components/tailwind-indicator.tsx diff --git a/components/recurring/components/account-switcher.tsx b/apps/www/components/transactions/components/account-switcher.tsx similarity index 100% rename from components/recurring/components/account-switcher.tsx rename to apps/www/components/transactions/components/account-switcher.tsx diff --git a/components/recurring/components/allocation-table-next.tsx b/apps/www/components/transactions/components/allocation-table-next.tsx similarity index 100% rename from components/recurring/components/allocation-table-next.tsx rename to apps/www/components/transactions/components/allocation-table-next.tsx diff --git a/components/transactions/components/mail-display.tsx b/apps/www/components/transactions/components/mail-display.tsx similarity index 100% rename from components/transactions/components/mail-display.tsx rename to apps/www/components/transactions/components/mail-display.tsx diff --git a/components/transactions/components/mail-list.tsx b/apps/www/components/transactions/components/mail-list.tsx similarity index 100% rename from components/transactions/components/mail-list.tsx rename to apps/www/components/transactions/components/mail-list.tsx diff --git a/components/transactions/components/nav.tsx b/apps/www/components/transactions/components/nav.tsx similarity index 100% rename from components/transactions/components/nav.tsx rename to apps/www/components/transactions/components/nav.tsx diff --git a/components/investments/components/positions-table.tsx b/apps/www/components/transactions/components/positions-table.tsx similarity index 100% rename from components/investments/components/positions-table.tsx rename to apps/www/components/transactions/components/positions-table.tsx diff --git a/apps/www/components/transactions/components/recurring-dashboard.tsx b/apps/www/components/transactions/components/recurring-dashboard.tsx new file mode 100644 index 00000000..a0df9fc0 --- /dev/null +++ b/apps/www/components/transactions/components/recurring-dashboard.tsx @@ -0,0 +1,287 @@ +"use client"; + +import * as React from "react"; +import { + BadgeDollarSign, + BarChart, + Briefcase, + Building, + CreditCard, + DollarSign, + HelpCircle, + Layers, + LayoutDashboard, + PiggyBank, + Repeat2, + Settings, + Sparkle, + Sprout, + Tag, + Wallet, +} from "lucide-react"; + +import { cn } from "@/lib/utils"; +import { Input } from "@/components/ui/input"; +import { + ResizableHandle, + ResizablePanel, + ResizablePanelGroup, +} from "@/components/ui/resizable"; +import { Separator } from "@/components/ui/separator"; +import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; +import { TooltipProvider } from "@/components/ui/tooltip"; +import { TopCategoriesTable } from "@/components/new-dashboard/components/top-categories-table"; + +import { Mail } from "@components/transactions/data"; +import { useMail } from "@components/transactions/use-mail"; +import { AccountSwitcher } from "@components/transactions/components/account-switcher"; +import { AccountsList } from "@components/accounts/components/accounts-list"; +import { CategoriesTable } from "@/components/recurring/components/allocation-table"; +import { RecurringTableNext } from "@components/transactions/components/allocation-table-next"; +import { CategoriesDisplay } from "@components/recurring/components/categories-display"; +import { HoldingsTable } from "@components/recurring/components/holdings-table"; +import { Investmentcards } from "@components/recurring/components/investment-cards"; +import { Nav } from "@components/transactions/components/nav"; +import { SmallInvestmentCard } from "@components/recurring/components/small-investment-card"; +import { RecurringSpentSoFarCard } from "@components/recurring/components/total-balance-card"; + +interface MailProps { + accounts: { + label: string; + email: string; + icon: React.ReactNode; + }[]; + mails: Mail[]; + defaultLayout: number[] | undefined; + defaultCollapsed?: boolean; + navCollapsedSize: number; +} + +export function RecurringDashboard({ + accounts, + mails, + defaultLayout = [265, 440, 400], + defaultCollapsed = false, + navCollapsedSize, +}: MailProps) { + const [isCollapsed, setIsCollapsed] = React.useState(defaultCollapsed); + const [mail] = useMail(); + + return ( + + { + document.cookie = `react-resizable-panels:layout=${JSON.stringify( + sizes, + )}`; + }} + className="h-full max-h-[1200px] items-stretch" + > + { + setIsCollapsed(collapsed); + document.cookie = `react-resizable-panels:collapsed=${JSON.stringify( + collapsed, + )}`; + }} + className={cn( + isCollapsed && + "min-w-[50px] transition-all duration-300 ease-in-out", + )} + > +
+ +
+ +