From 3d28b7e7a878f8ef860fb6c898a94e84835b817f Mon Sep 17 00:00:00 2001 From: Willie Chalmers III Date: Tue, 20 Feb 2024 10:03:12 -0800 Subject: [PATCH 01/25] Run code formatter --- .github/ISSUE_TEMPLATE/bug-report.md | 13 +- .github/ISSUE_TEMPLATE/internal-task.md | 14 +- .github/ISSUE_TEMPLATE/user-story.md | 9 +- .github/pull_request_template.md | 6 +- .github/workflows/main.yml | 2 +- README.md | 2 + next.config.js | 4 +- postcss.config.js | 2 +- src/app/api/audit-log/calls/route.ts | 64 +++---- src/app/api/audit-log/message/route.ts | 68 ++++--- src/app/api/auth/[...nextauth]/route.ts | 6 +- src/app/api/crm_example/route.ts | 35 ++-- src/app/api/crmconfig/airtable/route.ts | 38 ++-- src/app/dashboard/Home.css | 14 +- src/app/dashboard/layout.tsx | 70 ++++---- src/app/dashboard/page.tsx | 53 +++--- .../dashboard/settings/org/audit-log/page.tsx | 16 +- src/app/dashboard/settings/page.tsx | 86 ++++----- src/app/layout.tsx | 13 +- src/app/login/page.tsx | 16 +- src/app/page.tsx | 14 +- src/components/audittable/columns.tsx | 26 +-- src/components/clientTable/ClientTable.tsx | 4 +- src/components/nextAuthProvider.tsx | 3 +- src/components/notes/index.tsx | 8 +- src/components/sidebar/index.tsx | 48 ++--- src/components/ui/avatar.tsx | 26 +-- src/components/ui/button.tsx | 28 +-- src/components/ui/card.tsx | 41 +++-- src/components/ui/checkbox.tsx | 18 +- src/components/ui/collapsible.tsx | 12 +- src/components/ui/dropdown-menu.tsx | 82 ++++----- src/components/ui/input.tsx | 16 +- src/components/ui/label.tsx | 20 +-- src/components/ui/menubar.tsx | 98 +++++------ src/components/ui/popover.tsx | 20 +-- src/components/ui/scroll-area.tsx | 20 +-- src/components/ui/separator.tsx | 20 +-- src/components/ui/single-form.tsx | 33 ++-- src/components/ui/skeleton.tsx | 6 +- src/components/ui/switch.tsx | 18 +- src/components/ui/table.tsx | 44 ++--- src/components/ui/textarea.tsx | 16 +- src/lib/auth.ts | 166 +++++++++--------- src/lib/aws/s3.ts | 11 +- src/lib/crm/airtable.ts | 75 +++++--- src/lib/crm/types.ts | 9 +- src/lib/hooks/useCalls.ts | 2 +- src/lib/twilioClient.ts | 2 +- src/styles/globals.css | 2 +- 50 files changed, 725 insertions(+), 694 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md index ad1251d..2c3e284 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.md +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -4,29 +4,30 @@ about: Create a report to help us improve title: "[Bug]" labels: bug assignees: israelhhh2 - --- # Description -*A clear and concise description of what the bug is.* +_A clear and concise description of what the bug is._ # Expected Behavior -*A clear and concise description of what you expected to happen.* +_A clear and concise description of what you expected to happen._ # How to Reproduce Steps to reproduce the behavior: + 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error ## Runtime Environment - - OS and version: [e.g. Windows 11/macOS Sonoma/Android 12/etc.] - - Browser and Version [e.g. Chrome 121] + +- OS and version: [e.g. Windows 11/macOS Sonoma/Android 12/etc.] +- Browser and Version [e.g. Chrome 121] # Additional context -*Add any other context about the problem here. If applicable, add screenshots to help explain your problem. Remove if not needed.* +_Add any other context about the problem here. If applicable, add screenshots to help explain your problem. Remove if not needed._ diff --git a/.github/ISSUE_TEMPLATE/internal-task.md b/.github/ISSUE_TEMPLATE/internal-task.md index 78b8f6c..a9916d2 100644 --- a/.github/ISSUE_TEMPLATE/internal-task.md +++ b/.github/ISSUE_TEMPLATE/internal-task.md @@ -1,27 +1,27 @@ --- name: Internal Task -about: Generic issue for detailed work that needs to be done that isn't necessarily user-facing -title: '[Internal]' +about: Generic issue for detailed work that needs to be done that isn't necessarily user-facing +title: "[Internal]" labels: internal -assignees: '' +assignees: "" --- # Overview -*Describe the nature of this issue at a high level.* +_Describe the nature of this issue at a high level._ # Acceptance Criteria -*Describe what specific conditions must be met for this issue to be resolved.* +_Describe what specific conditions must be met for this issue to be resolved._ - [ ] Criteria 1 # Tasks -*If applicable, include a recommended set of non-user-facing technical tasks needed for a developer to implement this issue.* +_If applicable, include a recommended set of non-user-facing technical tasks needed for a developer to implement this issue._ - [ ] Task 1 # Additional Info -*If there are any additional documents or supplementary materials to resolve this issue, link them here. Remove if not needed.* +_If there are any additional documents or supplementary materials to resolve this issue, link them here. Remove if not needed._ diff --git a/.github/ISSUE_TEMPLATE/user-story.md b/.github/ISSUE_TEMPLATE/user-story.md index 4e1c260..cb5125f 100644 --- a/.github/ISSUE_TEMPLATE/user-story.md +++ b/.github/ISSUE_TEMPLATE/user-story.md @@ -1,23 +1,22 @@ --- name: User Story about: Generic user story template for a new user-facing feature -title: '' +title: "" labels: feature -assignees: '' - +assignees: "" --- **As a [USER TYPE], I should be able to [TASK] so I can [REASON].** # Acceptance Criteria -*Describe what conditions must be met for this issue to be resolved.* +_Describe what conditions must be met for this issue to be resolved._ - [ ] Criteria 1 # Tasks -*If applicable, include a recommended set of non-user-facing technical tasks needed for a developer to implement this issue.* +_If applicable, include a recommended set of non-user-facing technical tasks needed for a developer to implement this issue._ - [ ] Task 1 diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 6b6601d..789b344 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,9 +1,9 @@ # Overview -*Closes #X, closes, #Y* +_Closes #X, closes, #Y_ -*At a high-level, describe what changed. Details should already be included in the linked issues.* +_At a high-level, describe what changed. Details should already be included in the linked issues._ # Other Notes -*If there is important information that isn't immediately obvious from the changes that were made, include that info here. Remove this section if not needed.* +_If there is important information that isn't immediately obvious from the changes that were made, include that info here. Remove this section if not needed._ diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4d9f0ec..06ced5b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: 20 - + - name: Set up pnpm uses: pnpm/action-setup@v2 with: diff --git a/README.md b/README.md index 364b791..059130f 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,7 @@ View the latest deployment branch [here](https://develop.d2r9j66448p933.amplifya This project has been integrated with the AWS amplify github app for automatic deployments. All commits and pull requests to the `develop` branch have been set up for automatic deployment. Deployment and build settings should be edited through the AWS Amplify [console](https://console.aws.amazon.com/amplify/home) and through associated [documentation](https://docs.aws.amazon.com/amplify/latest/userguide/getting-started.html). Deployment build setting specifications: + - Changed node version to 20 to be compatible with building next.js applications to fulfil requirement >=18.17.0 - Changed container image to be Amazon linux 2023 to solve [GLIBC_2.28 not found](https://stackoverflow.com/questions/72921215/getting-glibc-2-28-not-found) error after upgrading node version. - Added npmrc file as a linker between pnpm and npm because amplify does some part of its installation using npm [here](https://docs.aws.amazon.com/amplify/latest/userguide/monorepo-configuration.html#turborepo-pnpm-monorepo-configuration). @@ -57,6 +58,7 @@ Deployment build setting specifications: ## Environment Setup ### Environment Variables + Create a .env file at the root of the repository with the following variables: NEXTAUTH_URL=http://localhost:3000 OKTA_OAUTH2_CLIENT_ID={OKTA APPLICATION CLIENT ID} diff --git a/next.config.js b/next.config.js index 767719f..658404a 100644 --- a/next.config.js +++ b/next.config.js @@ -1,4 +1,4 @@ /** @type {import('next').NextConfig} */ -const nextConfig = {} +const nextConfig = {}; -module.exports = nextConfig +module.exports = nextConfig; diff --git a/postcss.config.js b/postcss.config.js index 33ad091..12a703d 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -3,4 +3,4 @@ module.exports = { tailwindcss: {}, autoprefixer: {}, }, -} +}; diff --git a/src/app/api/audit-log/calls/route.ts b/src/app/api/audit-log/calls/route.ts index bb7624a..8170907 100644 --- a/src/app/api/audit-log/calls/route.ts +++ b/src/app/api/audit-log/calls/route.ts @@ -1,44 +1,36 @@ - -import {NextResponse, NextRequest} from 'next/server'; -import { formatDate } from '@/lib/utils'; - +import { NextResponse, NextRequest } from "next/server"; +import { formatDate } from "@/lib/utils"; interface Calls { - id: string; - direction: string; - from: string | null; - to: string | null; - timestamp: string; + id: string; + direction: string; + from: string | null; + to: string | null; + timestamp: string; } -export async function GET( - request: NextRequest, - res: NextResponse -) { - const accountSid = process.env.TWILIO_ACCOUNT_SID; - const authToken = process.env.TWILIO_AUTH_TOKEN; - const client = require('twilio')(accountSid, authToken); - try{ - const calls: any[] = await client.calls.list({limit:20}); +export async function GET(request: NextRequest, res: NextResponse) { + const accountSid = process.env.TWILIO_ACCOUNT_SID; + const authToken = process.env.TWILIO_AUTH_TOKEN; + const client = require("twilio")(accountSid, authToken); + try { + const calls: any[] = await client.calls.list({ limit: 20 }); //if want to display all calls, can delete the limit parameter - const formattedCalls: Calls[] = calls.map(call => { - const date = new Date(call.dateCreated); - const formattedDate = formatDate(date, 'YYYY-MM-DD HH:mm') - return { - id: call.sid, - from: call.from, - to: call.to, - direction: call.direction, - timestamp: formattedDate // Use the formatted date string - }; + const formattedCalls: Calls[] = calls.map((call) => { + const date = new Date(call.dateCreated); + const formattedDate = formatDate(date, "YYYY-MM-DD HH:mm"); + return { + id: call.sid, + from: call.from, + to: call.to, + direction: call.direction, + timestamp: formattedDate, // Use the formatted date string + }; }); - return NextResponse.json(formattedCalls) - - } catch (error) { - console.error('Error fetching call logs', error); - } - + return NextResponse.json(formattedCalls); + } catch (error) { + console.error("Error fetching call logs", error); + } } -export const dynamic = 'force-dynamic' - +export const dynamic = "force-dynamic"; diff --git a/src/app/api/audit-log/message/route.ts b/src/app/api/audit-log/message/route.ts index 18eae20..0b7301a 100644 --- a/src/app/api/audit-log/message/route.ts +++ b/src/app/api/audit-log/message/route.ts @@ -1,46 +1,38 @@ - -import {NextResponse, NextRequest} from 'next/server'; -import { formatDate } from '@/lib/utils'; +import { NextResponse, NextRequest } from "next/server"; +import { formatDate } from "@/lib/utils"; interface Message { - id: string; - from: string; - to: string; - direction: string; - timestamp: string; + id: string; + from: string; + to: string; + direction: string; + timestamp: string; } -export async function GET( - request: NextRequest, - res: NextResponse -) { - const accountSid = process.env.TWILIO_ACCOUNT_SID; - const authToken = process.env.TWILIO_AUTH_TOKEN; - const client = require('twilio')(accountSid, authToken); - try{ - const messages: any[] = await client.messages.list({limit:20}); +export async function GET(request: NextRequest, res: NextResponse) { + const accountSid = process.env.TWILIO_ACCOUNT_SID; + const authToken = process.env.TWILIO_AUTH_TOKEN; + const client = require("twilio")(accountSid, authToken); + try { + const messages: any[] = await client.messages.list({ limit: 20 }); //if want to display all calls, can delete the limit parameter - const formattedMessages: Message[] = messages.map(message => { - const date = new Date(message.dateCreated); - const formattedDate = formatDate(date, 'YYYY-MM-DD HH:mm') - return{ - id: message.sid, - direction: message.direction, - from: message.from, - to: message.to, - timestamp: formattedDate - } - - - }) - + const formattedMessages: Message[] = messages.map((message) => { + const date = new Date(message.dateCreated); + const formattedDate = formatDate(date, "YYYY-MM-DD HH:mm"); + return { + id: message.sid, + direction: message.direction, + from: message.from, + to: message.to, + timestamp: formattedDate, + }; + }); + // console.log(formattedMessages) - return NextResponse.json(formattedMessages) - - } catch (error) { - console.error('Error fetching message logs', error); - } - + return NextResponse.json(formattedMessages); + } catch (error) { + console.error("Error fetching message logs", error); + } } -export const dynamic = 'force-dynamic' \ No newline at end of file +export const dynamic = "force-dynamic"; diff --git a/src/app/api/auth/[...nextauth]/route.ts b/src/app/api/auth/[...nextauth]/route.ts index 04838fd..9cd7923 100644 --- a/src/app/api/auth/[...nextauth]/route.ts +++ b/src/app/api/auth/[...nextauth]/route.ts @@ -1,5 +1,5 @@ -import NextAuth from 'next-auth'; -import { authOptions } from '@/lib/auth'; +import NextAuth from "next-auth"; +import { authOptions } from "@/lib/auth"; const handler = NextAuth(authOptions); -export { handler as GET, handler as POST }; \ No newline at end of file +export { handler as GET, handler as POST }; diff --git a/src/app/api/crm_example/route.ts b/src/app/api/crm_example/route.ts index 411c3cd..418330b 100644 --- a/src/app/api/crm_example/route.ts +++ b/src/app/api/crm_example/route.ts @@ -1,32 +1,37 @@ -import { AirtableCRMProvider, s3KeyForAirtableToken, s3KeyForAirtableBase, s3KeyForAirtableTable } from "../../../lib/crm/airtable"; +import { + AirtableCRMProvider, + s3KeyForAirtableToken, + s3KeyForAirtableBase, + s3KeyForAirtableTable, +} from "../../../lib/crm/airtable"; import { authOptions } from "@/lib/auth"; import { getObjectString } from "@/lib/aws/s3"; import { getServerSession } from "next-auth/next"; -import { NextRequest} from "next/server"; +import { NextRequest } from "next/server"; // ENV variables for now, pending CRM configuration feature - /** * GET /api/crm_example?phone={phone_number_string} - * + * * @param request - The incoming request object. * @returns A JSON response with the client info. -*/ + */ export async function GET(request: NextRequest) { - const session = await getServerSession(authOptions) as any; + const session = (await getServerSession(authOptions)) as any; if (!session) { - return new Response('Unauthorized', { status: 401 }); + return new Response("Unauthorized", { status: 401 }); } const oktaId = session.oktaId; - - const [airtable_token, airtable_base_id, airtable_table_id] = await Promise.all([ - getObjectString(s3KeyForAirtableToken(oktaId)), - getObjectString(s3KeyForAirtableBase(oktaId)), - getObjectString(s3KeyForAirtableTable(oktaId)) - ]); - console.log(airtable_token, airtable_base_id, airtable_table_id) + const [airtable_token, airtable_base_id, airtable_table_id] = + await Promise.all([ + getObjectString(s3KeyForAirtableToken(oktaId)), + getObjectString(s3KeyForAirtableBase(oktaId)), + getObjectString(s3KeyForAirtableTable(oktaId)), + ]); + + console.log(airtable_token, airtable_base_id, airtable_table_id); const provider = new AirtableCRMProvider(airtable_base_id, airtable_token); @@ -45,4 +50,4 @@ export async function GET(request: NextRequest) { "content-type": "application/json", }, }); -} \ No newline at end of file +} diff --git a/src/app/api/crmconfig/airtable/route.ts b/src/app/api/crmconfig/airtable/route.ts index 69d63e6..c88f5c1 100644 --- a/src/app/api/crmconfig/airtable/route.ts +++ b/src/app/api/crmconfig/airtable/route.ts @@ -1,9 +1,13 @@ -import { NextApiRequest, NextApiResponse } from 'next'; +import { NextApiRequest, NextApiResponse } from "next"; import { getServerSession } from "next-auth/next"; -import { putObject, getObjectString } from '../../../../lib/aws/s3'; -import { authOptions } from '@/lib/auth'; -import { NextRequest, NextResponse } from 'next/server'; -import { s3KeyForAirtableBase, s3KeyForAirtableTable, s3KeyForAirtableToken } from '@/lib/crm/airtable'; +import { putObject, getObjectString } from "../../../../lib/aws/s3"; +import { authOptions } from "@/lib/auth"; +import { NextRequest, NextResponse } from "next/server"; +import { + s3KeyForAirtableBase, + s3KeyForAirtableTable, + s3KeyForAirtableToken, +} from "@/lib/crm/airtable"; type AirtableTokenData = { token: string; @@ -12,35 +16,33 @@ type AirtableTokenData = { }; export async function POST(req: NextRequest) { - const session = await getServerSession(authOptions) as any; - - + const session = (await getServerSession(authOptions)) as any; + const res = NextResponse.next(); if (!session) { - return new Response('Unauthorized', { status: 401 }); + return new Response("Unauthorized", { status: 401 }); } - const oktaId = session.oktaId; - const body = await req.json() as AirtableTokenData; + const oktaId = session.oktaId; + const body = (await req.json()) as AirtableTokenData; const token = body.token; const baseId = body.baseId; const tableId = body.tableId; - + try { const tokenKey = s3KeyForAirtableToken(oktaId); const baseIdKey = s3KeyForAirtableBase(oktaId); const tableIdKey = s3KeyForAirtableTable(oktaId); - + await Promise.all([ putObject(tokenKey, token), putObject(baseIdKey, baseId), - putObject(tableIdKey, tableId) + putObject(tableIdKey, tableId), ]); - - return new Response('Success', { status: 200 }); + return new Response("Success", { status: 200 }); } catch (error) { console.error(error); - return new Response('Put in S3 unsuccessful: ' + error, { status: 500 }); + return new Response("Put in S3 unsuccessful: " + error, { status: 500 }); } -}; \ No newline at end of file +} diff --git a/src/app/dashboard/Home.css b/src/app/dashboard/Home.css index 6833940..bd4d8dd 100644 --- a/src/app/dashboard/Home.css +++ b/src/app/dashboard/Home.css @@ -1,27 +1,27 @@ .step-oval::before { - content: ''; + content: ""; position: absolute; top: 50%; left: 50%; width: 100%; /* Adjust width as needed */ height: 45px; /* Adjust height as needed */ border-radius: 30px; - border: 2px solid #E2E8F0; /* Adjust color as needed */ + border: 2px solid #e2e8f0; /* Adjust color as needed */ transform: translate(-50%, -50%); z-index: 0; } .step-oval.active::before { - border-color: #FF9500; /* Adjust for active step */ + border-color: #ff9500; /* Adjust for active step */ } .step-oval.completed::before { - border-color: #FF9500; /* Adjust for completed step */ + border-color: #ff9500; /* Adjust for completed step */ } .step-checkmark::after { - content: '\2714'; /* Unicode checkmark */ - color: #FF9500; /* Adjust checkmark color as needed */ + content: "\2714"; /* Unicode checkmark */ + color: #ff9500; /* Adjust checkmark color as needed */ font-size: 18px; position: absolute; top: 50%; @@ -29,5 +29,3 @@ transform: translate(-50%, -50%); z-index: 1; } - - diff --git a/src/app/dashboard/layout.tsx b/src/app/dashboard/layout.tsx index ed3f94a..304c52f 100644 --- a/src/app/dashboard/layout.tsx +++ b/src/app/dashboard/layout.tsx @@ -1,7 +1,7 @@ "use client"; -import { useSession } from 'next-auth/react'; -import { redirect } from 'next/navigation' -import React from 'react'; +import { useSession } from "next-auth/react"; +import { redirect } from "next/navigation"; +import React from "react"; import Appbar from "../../components/appbar"; import Sidebar from "../../components/sidebar"; @@ -9,39 +9,39 @@ import "../../styles/globals.css"; export default function Layout({ - children, + children, }: { - children: React.ReactNode; + children: React.ReactNode; }) { - const { data: session, status } = useSession(); - if (status === 'loading') { - return Loading...; - } else if (session) { - const isProgramManager = true; // TODO - let initials = "AA"; - if (session.user?.name) { - const parts = session.user.name.split(' '); - if (parts.length > 1) { - initials = (parts[0][0] + parts[1][0]).toUpperCase(); - } else if (parts.length > 0) { - initials = parts[0][0].toUpperCase(); - } - } - return ( -
- -
- -
- {children} -
-
-
- ); - } else { - redirect('/login'); + const { data: session, status } = useSession(); + if (status === 'loading') { + return Loading...; + } else if (session) { + const isProgramManager = true; // TODO + let initials = "AA"; + if (session.user?.name) { + const parts = session.user.name.split(' '); + if (parts.length > 1) { + initials = (parts[0][0] + parts[1][0]).toUpperCase(); + } else if (parts.length > 0) { + initials = parts[0][0].toUpperCase(); + } } + return ( +
+ +
+ +
+ {children} +
+
+
+ ); + } else { + redirect('/login'); + } } diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx index 93febf3..2cf263f 100644 --- a/src/app/dashboard/page.tsx +++ b/src/app/dashboard/page.tsx @@ -1,26 +1,25 @@ -'use client'; - -import React, { useState } from 'react'; -import './Home.css'; +"use client"; +import React, { useState } from "react"; +import "./Home.css"; const steps = [ "Dashboard Cards", "Notifications", "Communicate With Clients", - "Change Status" + "Change Status", ]; - export default function DashboardHome() { const [currentPage, setCurrentPage] = useState(0); - const [completedSteps, setCompletedSteps] = useState(new Array(steps.length).fill(false)); + const [completedSteps, setCompletedSteps] = useState( + new Array(steps.length).fill(false), + ); // const tutorialCompleted = localStorage.getItem('tutorialCompleted') === 'true'; // const [showPopup, setShowPopup] = useState(!tutorialCompleted); const [showPopup, setShowPopup] = useState(true); const [showFinishButton, setShowFinishButton] = useState(false); - const goToNextPage = () => { const newCompletedSteps = [...completedSteps]; newCompletedSteps[currentPage] = true; @@ -32,7 +31,6 @@ export default function DashboardHome() { } }; - const finishTutorial = () => { // Set the last step as completed before closing const newCompletedSteps = [...completedSteps]; @@ -42,38 +40,53 @@ export default function DashboardHome() { setShowPopup(false); }; - return ( -
+
{showPopup && (
-

Welcome to Connie.

-

We’re so happy you’re here. Get to know your space through a few simple steps. Here are the main functions of your dashboard:

+

+ We’re so happy you’re here. Get to know your space through a few + simple steps. Here are the main functions of your dashboard: +

{steps.map((step, index) => ( -
-
+
+
))}
-
{steps.map((step, index) => ( -
-
+
+
{step}
))}
{steps.map((content, index) => ( -
+
{`Content for ${content}`}
))} @@ -85,7 +98,7 @@ export default function DashboardHome() { className="bg-orange-500 hover:bg-orange-600 text-white font-bold py-2 px-4 rounded" onClick={goToNextPage} > - {currentPage === steps.length - 1 ? 'Finish' : 'Next'} + {currentPage === steps.length - 1 ? "Finish" : "Next"} ) : ( + ); } diff --git a/src/app/page.tsx b/src/app/page.tsx index 1a07f78..ba0cf07 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,16 +1,16 @@ "use client"; -import { useSession } from 'next-auth/react'; -import React from 'react'; -import { redirect } from 'next/navigation' +import { useSession } from "next-auth/react"; +import React from "react"; +import { redirect } from "next/navigation"; export default function Home() { const { data: session, status } = useSession(); - if (status === 'loading') { + if (status === "loading") { return Loading...; } else if (session) { - redirect('/dashboard'); + redirect("/dashboard"); } else { - redirect('/login'); + redirect("/login"); } -} \ No newline at end of file +} diff --git a/src/components/audittable/columns.tsx b/src/components/audittable/columns.tsx index 3286697..aed26b5 100644 --- a/src/components/audittable/columns.tsx +++ b/src/components/audittable/columns.tsx @@ -1,10 +1,10 @@ -"use client" +"use client"; -import { ColumnDef } from "@tanstack/react-table" -import { MoreHorizontal } from "lucide-react" -import { Checkbox } from "@/components/ui/checkbox" +import { ColumnDef } from "@tanstack/react-table"; +import { MoreHorizontal } from "lucide-react"; +import { Checkbox } from "@/components/ui/checkbox"; -import { Button } from "@/components/ui/button" +import { Button } from "@/components/ui/button"; import { DropdownMenu, DropdownMenuContent, @@ -12,8 +12,7 @@ import { DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, -} from "@/components/ui/dropdown-menu" - +} from "@/components/ui/dropdown-menu"; // This type is used to define the shape of our data. export type FetchedCalls = { @@ -22,7 +21,7 @@ export type FetchedCalls = { from: string | null; to: string | null; timestamp: string; -} +}; export const columns: ColumnDef[] = [ { @@ -33,7 +32,9 @@ export const columns: ColumnDef[] = [ table.getIsAllPageRowsSelected() || (table.getIsSomePageRowsSelected() && "indeterminate") } - onCheckedChange={(value: any) => table.toggleAllPageRowsSelected(!!value)} + onCheckedChange={(value: any) => + table.toggleAllPageRowsSelected(!!value) + } aria-label="Select all" /> ), @@ -69,7 +70,7 @@ export const columns: ColumnDef[] = [ { id: "actions", cell: ({ row }) => { - const call = row.original + const call = row.original; return ( @@ -90,8 +91,7 @@ export const columns: ColumnDef[] = [ View details - ) + ); }, }, - -] +]; diff --git a/src/components/clientTable/ClientTable.tsx b/src/components/clientTable/ClientTable.tsx index 56e4b5d..e19956e 100644 --- a/src/components/clientTable/ClientTable.tsx +++ b/src/components/clientTable/ClientTable.tsx @@ -94,7 +94,7 @@ export function ClientTable({ columns, data }: DataTableProps) { ? null : flexRender( header.column.columnDef.header, - header.getContext() + header.getContext(), )} ); @@ -113,7 +113,7 @@ export function ClientTable({ columns, data }: DataTableProps) { {flexRender( cell.column.columnDef.cell, - cell.getContext() + cell.getContext(), )} ))} diff --git a/src/components/nextAuthProvider.tsx b/src/components/nextAuthProvider.tsx index dc54b04..dca15b1 100644 --- a/src/components/nextAuthProvider.tsx +++ b/src/components/nextAuthProvider.tsx @@ -7,6 +7,5 @@ type Props = { }; export const NextAuthProvider = ({ children }: Props) => { - return {children}; -}; \ No newline at end of file +}; diff --git a/src/components/notes/index.tsx b/src/components/notes/index.tsx index 153c502..3ab2a45 100644 --- a/src/components/notes/index.tsx +++ b/src/components/notes/index.tsx @@ -29,11 +29,11 @@ export default function Notes({ clientId }: { clientId: string }) { setLoading(true); try { const response = await fetch( - `${process.env.NEXT_PUBLIC_URL}/api/notes?clientId=${clientId}` + `${process.env.NEXT_PUBLIC_URL}/api/notes?clientId=${clientId}`, ); const data = await response.json(); data.sort((a: NoteData, b: NoteData) => - dayjs(b.dateCreated).diff(dayjs(a.dateCreated)) + dayjs(b.dateCreated).diff(dayjs(a.dateCreated)), ); setNotes(data); setFilteredNotes(data); @@ -66,7 +66,7 @@ export default function Notes({ clientId }: { clientId: string }) { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ note: newNote }), - } + }, ); const data = await response.json(); @@ -99,7 +99,7 @@ export default function Notes({ clientId }: { clientId: string }) { setSearchItem(searchTerm); const filteredNotes = notes.filter((note) => - note.content.toLowerCase().includes(searchTerm) + note.content.toLowerCase().includes(searchTerm), ); setFilteredNotes(filteredNotes); diff --git a/src/components/sidebar/index.tsx b/src/components/sidebar/index.tsx index c09f433..76f2a73 100644 --- a/src/components/sidebar/index.tsx +++ b/src/components/sidebar/index.tsx @@ -11,20 +11,16 @@ import { ListChecks, Settings, SquareUser, - ChevronsUpDown + ChevronsUpDown, } from "lucide-react"; - - import { Collapsible, CollapsibleContent, CollapsibleTrigger, -} from "@/components/ui/collapsible" +} from "@/components/ui/collapsible"; import { useState } from "react"; - - interface ButtonLinkProps extends React.HTMLAttributes { href: string; } @@ -34,14 +30,13 @@ const ButtonLink = ({ href, children }: ButtonLinkProps) => { const isActive = pathname === href; return ( - - + ); }; @@ -50,14 +45,13 @@ interface SidebarProps extends React.HTMLAttributes { } export default function Sidebar({ className, isProgramManager }: SidebarProps) { - // const [settingOpen, setSettingOpen] = useState(true); return (
@@ -86,24 +80,20 @@ export default function Sidebar({ className, isProgramManager }: SidebarProps) { Clients - - - - - Settings - - + + + Settings + + <> - + - - - Audit-log - - + Audit-log + +
); diff --git a/src/components/ui/avatar.tsx b/src/components/ui/avatar.tsx index 51e507b..09cd14d 100644 --- a/src/components/ui/avatar.tsx +++ b/src/components/ui/avatar.tsx @@ -1,9 +1,9 @@ -"use client" +"use client"; -import * as React from "react" -import * as AvatarPrimitive from "@radix-ui/react-avatar" +import * as React from "react"; +import * as AvatarPrimitive from "@radix-ui/react-avatar"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; const Avatar = React.forwardRef< React.ElementRef, @@ -13,12 +13,12 @@ const Avatar = React.forwardRef< ref={ref} className={cn( "relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", - className + className, )} {...props} /> -)) -Avatar.displayName = AvatarPrimitive.Root.displayName +)); +Avatar.displayName = AvatarPrimitive.Root.displayName; const AvatarImage = React.forwardRef< React.ElementRef, @@ -29,8 +29,8 @@ const AvatarImage = React.forwardRef< className={cn("aspect-square h-full w-full", className)} {...props} /> -)) -AvatarImage.displayName = AvatarPrimitive.Image.displayName +)); +AvatarImage.displayName = AvatarPrimitive.Image.displayName; const AvatarFallback = React.forwardRef< React.ElementRef, @@ -40,11 +40,11 @@ const AvatarFallback = React.forwardRef< ref={ref} className={cn( "flex h-full w-full items-center justify-center rounded-full bg-muted", - className + className, )} {...props} /> -)) -AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName +)); +AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName; -export { Avatar, AvatarImage, AvatarFallback } +export { Avatar, AvatarImage, AvatarFallback }; diff --git a/src/components/ui/button.tsx b/src/components/ui/button.tsx index b99c50f..57c9fe4 100644 --- a/src/components/ui/button.tsx +++ b/src/components/ui/button.tsx @@ -1,8 +1,8 @@ -import * as React from "react" -import { Slot } from "@radix-ui/react-slot" -import { cva, type VariantProps } from "class-variance-authority" +import * as React from "react"; +import { Slot } from "@radix-ui/react-slot"; +import { cva, type VariantProps } from "class-variance-authority"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; const buttonVariants = cva( "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", @@ -30,27 +30,27 @@ const buttonVariants = cva( variant: "default", size: "default", }, - } -) + }, +); export interface ButtonProps extends React.ButtonHTMLAttributes, - VariantProps { - asChild?: boolean + VariantProps { + asChild?: boolean; } const Button = React.forwardRef( ({ className, variant, size, asChild = false, ...props }, ref) => { - const Comp = asChild ? Slot : "button" + const Comp = asChild ? Slot : "button"; return ( - ) - } -) -Button.displayName = "Button" + ); + }, +); +Button.displayName = "Button"; -export { Button, buttonVariants } +export { Button, buttonVariants }; diff --git a/src/components/ui/card.tsx b/src/components/ui/card.tsx index afa13ec..dc3b01d 100644 --- a/src/components/ui/card.tsx +++ b/src/components/ui/card.tsx @@ -1,6 +1,6 @@ -import * as React from "react" +import * as React from "react"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; const Card = React.forwardRef< HTMLDivElement, @@ -10,12 +10,12 @@ const Card = React.forwardRef< ref={ref} className={cn( "rounded-lg border bg-card text-card-foreground shadow-sm", - className + className, )} {...props} /> -)) -Card.displayName = "Card" +)); +Card.displayName = "Card"; const CardHeader = React.forwardRef< HTMLDivElement, @@ -26,8 +26,8 @@ const CardHeader = React.forwardRef< className={cn("flex flex-col space-y-1.5 p-6", className)} {...props} /> -)) -CardHeader.displayName = "CardHeader" +)); +CardHeader.displayName = "CardHeader"; const CardTitle = React.forwardRef< HTMLParagraphElement, @@ -37,12 +37,12 @@ const CardTitle = React.forwardRef< ref={ref} className={cn( "text-2xl font-semibold leading-none tracking-tight", - className + className, )} {...props} /> -)) -CardTitle.displayName = "CardTitle" +)); +CardTitle.displayName = "CardTitle"; const CardDescription = React.forwardRef< HTMLParagraphElement, @@ -53,16 +53,16 @@ const CardDescription = React.forwardRef< className={cn("text-sm text-muted-foreground", className)} {...props} /> -)) -CardDescription.displayName = "CardDescription" +)); +CardDescription.displayName = "CardDescription"; const CardContent = React.forwardRef< HTMLDivElement, React.HTMLAttributes >(({ className, ...props }, ref) => (
-)) -CardContent.displayName = "CardContent" +)); +CardContent.displayName = "CardContent"; const CardFooter = React.forwardRef< HTMLDivElement, @@ -73,7 +73,14 @@ const CardFooter = React.forwardRef< className={cn("flex items-center p-6 pt-0", className)} {...props} /> -)) -CardFooter.displayName = "CardFooter" +)); +CardFooter.displayName = "CardFooter"; -export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } +export { + Card, + CardHeader, + CardFooter, + CardTitle, + CardDescription, + CardContent, +}; diff --git a/src/components/ui/checkbox.tsx b/src/components/ui/checkbox.tsx index df61a13..5985e3c 100644 --- a/src/components/ui/checkbox.tsx +++ b/src/components/ui/checkbox.tsx @@ -1,10 +1,10 @@ -"use client" +"use client"; -import * as React from "react" -import * as CheckboxPrimitive from "@radix-ui/react-checkbox" -import { Check } from "lucide-react" +import * as React from "react"; +import * as CheckboxPrimitive from "@radix-ui/react-checkbox"; +import { Check } from "lucide-react"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; const Checkbox = React.forwardRef< React.ElementRef, @@ -14,7 +14,7 @@ const Checkbox = React.forwardRef< ref={ref} className={cn( "peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground", - className + className, )} {...props} > @@ -24,7 +24,7 @@ const Checkbox = React.forwardRef< -)) -Checkbox.displayName = CheckboxPrimitive.Root.displayName +)); +Checkbox.displayName = CheckboxPrimitive.Root.displayName; -export { Checkbox } +export { Checkbox }; diff --git a/src/components/ui/collapsible.tsx b/src/components/ui/collapsible.tsx index 9fa4894..cb003d1 100644 --- a/src/components/ui/collapsible.tsx +++ b/src/components/ui/collapsible.tsx @@ -1,11 +1,11 @@ -"use client" +"use client"; -import * as CollapsiblePrimitive from "@radix-ui/react-collapsible" +import * as CollapsiblePrimitive from "@radix-ui/react-collapsible"; -const Collapsible = CollapsiblePrimitive.Root +const Collapsible = CollapsiblePrimitive.Root; -const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger +const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger; -const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent +const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent; -export { Collapsible, CollapsibleTrigger, CollapsibleContent } +export { Collapsible, CollapsibleTrigger, CollapsibleContent }; diff --git a/src/components/ui/dropdown-menu.tsx b/src/components/ui/dropdown-menu.tsx index f69a0d6..3a0c7fe 100644 --- a/src/components/ui/dropdown-menu.tsx +++ b/src/components/ui/dropdown-menu.tsx @@ -1,27 +1,27 @@ -"use client" +"use client"; -import * as React from "react" -import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu" -import { Check, ChevronRight, Circle } from "lucide-react" +import * as React from "react"; +import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"; +import { Check, ChevronRight, Circle } from "lucide-react"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; -const DropdownMenu = DropdownMenuPrimitive.Root +const DropdownMenu = DropdownMenuPrimitive.Root; -const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger +const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger; -const DropdownMenuGroup = DropdownMenuPrimitive.Group +const DropdownMenuGroup = DropdownMenuPrimitive.Group; -const DropdownMenuPortal = DropdownMenuPrimitive.Portal +const DropdownMenuPortal = DropdownMenuPrimitive.Portal; -const DropdownMenuSub = DropdownMenuPrimitive.Sub +const DropdownMenuSub = DropdownMenuPrimitive.Sub; -const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup +const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup; const DropdownMenuSubTrigger = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef & { - inset?: boolean + inset?: boolean; } >(({ className, inset, children, ...props }, ref) => ( {children} -)) +)); DropdownMenuSubTrigger.displayName = - DropdownMenuPrimitive.SubTrigger.displayName + DropdownMenuPrimitive.SubTrigger.displayName; const DropdownMenuSubContent = React.forwardRef< React.ElementRef, @@ -48,13 +48,13 @@ const DropdownMenuSubContent = React.forwardRef< ref={ref} className={cn( "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", - className + className, )} {...props} /> -)) +)); DropdownMenuSubContent.displayName = - DropdownMenuPrimitive.SubContent.displayName + DropdownMenuPrimitive.SubContent.displayName; const DropdownMenuContent = React.forwardRef< React.ElementRef, @@ -66,18 +66,18 @@ const DropdownMenuContent = React.forwardRef< sideOffset={sideOffset} className={cn( "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", - className + className, )} {...props} /> -)) -DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName +)); +DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName; const DropdownMenuItem = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef & { - inset?: boolean + inset?: boolean; } >(({ className, inset, ...props }, ref) => ( -)) -DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName +)); +DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName; const DropdownMenuCheckboxItem = React.forwardRef< React.ElementRef, @@ -100,7 +100,7 @@ const DropdownMenuCheckboxItem = React.forwardRef< ref={ref} className={cn( "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", - className + className, )} checked={checked} {...props} @@ -112,9 +112,9 @@ const DropdownMenuCheckboxItem = React.forwardRef< {children} -)) +)); DropdownMenuCheckboxItem.displayName = - DropdownMenuPrimitive.CheckboxItem.displayName + DropdownMenuPrimitive.CheckboxItem.displayName; const DropdownMenuRadioItem = React.forwardRef< React.ElementRef, @@ -124,7 +124,7 @@ const DropdownMenuRadioItem = React.forwardRef< ref={ref} className={cn( "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", - className + className, )} {...props} > @@ -135,13 +135,13 @@ const DropdownMenuRadioItem = React.forwardRef< {children} -)) -DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName +)); +DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName; const DropdownMenuLabel = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef & { - inset?: boolean + inset?: boolean; } >(({ className, inset, ...props }, ref) => ( -)) -DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName +)); +DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName; const DropdownMenuSeparator = React.forwardRef< React.ElementRef, @@ -165,8 +165,8 @@ const DropdownMenuSeparator = React.forwardRef< className={cn("-mx-1 my-1 h-px bg-muted", className)} {...props} /> -)) -DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName +)); +DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName; const DropdownMenuShortcut = ({ className, @@ -177,9 +177,9 @@ const DropdownMenuShortcut = ({ className={cn("ml-auto text-xs tracking-widest opacity-60", className)} {...props} /> - ) -} -DropdownMenuShortcut.displayName = "DropdownMenuShortcut" + ); +}; +DropdownMenuShortcut.displayName = "DropdownMenuShortcut"; export { DropdownMenu, @@ -197,4 +197,4 @@ export { DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, -} +}; diff --git a/src/components/ui/input.tsx b/src/components/ui/input.tsx index 677d05f..9d631e7 100644 --- a/src/components/ui/input.tsx +++ b/src/components/ui/input.tsx @@ -1,6 +1,6 @@ -import * as React from "react" +import * as React from "react"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; export interface InputProps extends React.InputHTMLAttributes {} @@ -12,14 +12,14 @@ const Input = React.forwardRef( type={type} className={cn( "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", - className + className, )} ref={ref} {...props} /> - ) - } -) -Input.displayName = "Input" + ); + }, +); +Input.displayName = "Input"; -export { Input } +export { Input }; diff --git a/src/components/ui/label.tsx b/src/components/ui/label.tsx index 5341821..84f8b0c 100644 --- a/src/components/ui/label.tsx +++ b/src/components/ui/label.tsx @@ -1,14 +1,14 @@ -"use client" +"use client"; -import * as React from "react" -import * as LabelPrimitive from "@radix-ui/react-label" -import { cva, type VariantProps } from "class-variance-authority" +import * as React from "react"; +import * as LabelPrimitive from "@radix-ui/react-label"; +import { cva, type VariantProps } from "class-variance-authority"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; const labelVariants = cva( - "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" -) + "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", +); const Label = React.forwardRef< React.ElementRef, @@ -20,7 +20,7 @@ const Label = React.forwardRef< className={cn(labelVariants(), className)} {...props} /> -)) -Label.displayName = LabelPrimitive.Root.displayName +)); +Label.displayName = LabelPrimitive.Root.displayName; -export { Label } +export { Label }; diff --git a/src/components/ui/menubar.tsx b/src/components/ui/menubar.tsx index 5586fa9..843ef7b 100644 --- a/src/components/ui/menubar.tsx +++ b/src/components/ui/menubar.tsx @@ -1,20 +1,20 @@ -"use client" +"use client"; -import * as React from "react" -import * as MenubarPrimitive from "@radix-ui/react-menubar" -import { Check, ChevronRight, Circle } from "lucide-react" +import * as React from "react"; +import * as MenubarPrimitive from "@radix-ui/react-menubar"; +import { Check, ChevronRight, Circle } from "lucide-react"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; -const MenubarMenu = MenubarPrimitive.Menu +const MenubarMenu = MenubarPrimitive.Menu; -const MenubarGroup = MenubarPrimitive.Group +const MenubarGroup = MenubarPrimitive.Group; -const MenubarPortal = MenubarPrimitive.Portal +const MenubarPortal = MenubarPrimitive.Portal; -const MenubarSub = MenubarPrimitive.Sub +const MenubarSub = MenubarPrimitive.Sub; -const MenubarRadioGroup = MenubarPrimitive.RadioGroup +const MenubarRadioGroup = MenubarPrimitive.RadioGroup; const Menubar = React.forwardRef< React.ElementRef, @@ -24,12 +24,12 @@ const Menubar = React.forwardRef< ref={ref} className={cn( "flex h-10 items-center space-x-1 rounded-md border bg-background p-1", - className + className, )} {...props} /> -)) -Menubar.displayName = MenubarPrimitive.Root.displayName +)); +Menubar.displayName = MenubarPrimitive.Root.displayName; const MenubarTrigger = React.forwardRef< React.ElementRef, @@ -39,17 +39,17 @@ const MenubarTrigger = React.forwardRef< ref={ref} className={cn( "flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground", - className + className, )} {...props} /> -)) -MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName +)); +MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName; const MenubarSubTrigger = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef & { - inset?: boolean + inset?: boolean; } >(({ className, inset, children, ...props }, ref) => ( {children} -)) -MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName +)); +MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName; const MenubarSubContent = React.forwardRef< React.ElementRef, @@ -75,12 +75,12 @@ const MenubarSubContent = React.forwardRef< ref={ref} className={cn( "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", - className + className, )} {...props} /> -)) -MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName +)); +MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName; const MenubarContent = React.forwardRef< React.ElementRef, @@ -88,7 +88,7 @@ const MenubarContent = React.forwardRef< >( ( { className, align = "start", alignOffset = -4, sideOffset = 8, ...props }, - ref + ref, ) => ( - ) -) -MenubarContent.displayName = MenubarPrimitive.Content.displayName + ), +); +MenubarContent.displayName = MenubarPrimitive.Content.displayName; const MenubarItem = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef & { - inset?: boolean + inset?: boolean; } >(({ className, inset, ...props }, ref) => ( -)) -MenubarItem.displayName = MenubarPrimitive.Item.displayName +)); +MenubarItem.displayName = MenubarPrimitive.Item.displayName; const MenubarCheckboxItem = React.forwardRef< React.ElementRef, @@ -133,7 +133,7 @@ const MenubarCheckboxItem = React.forwardRef< ref={ref} className={cn( "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", - className + className, )} checked={checked} {...props} @@ -145,8 +145,8 @@ const MenubarCheckboxItem = React.forwardRef< {children} -)) -MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName +)); +MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName; const MenubarRadioItem = React.forwardRef< React.ElementRef, @@ -156,7 +156,7 @@ const MenubarRadioItem = React.forwardRef< ref={ref} className={cn( "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", - className + className, )} {...props} > @@ -167,13 +167,13 @@ const MenubarRadioItem = React.forwardRef< {children} -)) -MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName +)); +MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName; const MenubarLabel = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef & { - inset?: boolean + inset?: boolean; } >(({ className, inset, ...props }, ref) => ( -)) -MenubarLabel.displayName = MenubarPrimitive.Label.displayName +)); +MenubarLabel.displayName = MenubarPrimitive.Label.displayName; const MenubarSeparator = React.forwardRef< React.ElementRef, @@ -197,8 +197,8 @@ const MenubarSeparator = React.forwardRef< className={cn("-mx-1 my-1 h-px bg-muted", className)} {...props} /> -)) -MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName +)); +MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName; const MenubarShortcut = ({ className, @@ -208,13 +208,13 @@ const MenubarShortcut = ({ - ) -} -MenubarShortcut.displayname = "MenubarShortcut" + ); +}; +MenubarShortcut.displayname = "MenubarShortcut"; export { Menubar, @@ -233,4 +233,4 @@ export { MenubarGroup, MenubarSub, MenubarShortcut, -} +}; diff --git a/src/components/ui/popover.tsx b/src/components/ui/popover.tsx index a0ec48b..73be7bb 100644 --- a/src/components/ui/popover.tsx +++ b/src/components/ui/popover.tsx @@ -1,13 +1,13 @@ -"use client" +"use client"; -import * as React from "react" -import * as PopoverPrimitive from "@radix-ui/react-popover" +import * as React from "react"; +import * as PopoverPrimitive from "@radix-ui/react-popover"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; -const Popover = PopoverPrimitive.Root +const Popover = PopoverPrimitive.Root; -const PopoverTrigger = PopoverPrimitive.Trigger +const PopoverTrigger = PopoverPrimitive.Trigger; const PopoverContent = React.forwardRef< React.ElementRef, @@ -20,12 +20,12 @@ const PopoverContent = React.forwardRef< sideOffset={sideOffset} className={cn( "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", - className + className, )} {...props} /> -)) -PopoverContent.displayName = PopoverPrimitive.Content.displayName +)); +PopoverContent.displayName = PopoverPrimitive.Content.displayName; -export { Popover, PopoverTrigger, PopoverContent } +export { Popover, PopoverTrigger, PopoverContent }; diff --git a/src/components/ui/scroll-area.tsx b/src/components/ui/scroll-area.tsx index 0b4a48d..b1f1127 100644 --- a/src/components/ui/scroll-area.tsx +++ b/src/components/ui/scroll-area.tsx @@ -1,9 +1,9 @@ -"use client" +"use client"; -import * as React from "react" -import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area" +import * as React from "react"; +import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; const ScrollArea = React.forwardRef< React.ElementRef, @@ -20,8 +20,8 @@ const ScrollArea = React.forwardRef< -)) -ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName +)); +ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName; const ScrollBar = React.forwardRef< React.ElementRef, @@ -36,13 +36,13 @@ const ScrollBar = React.forwardRef< "h-full w-2.5 border-l border-l-transparent p-[1px]", orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]", - className + className, )} {...props} > -)) -ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName +)); +ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName; -export { ScrollArea, ScrollBar } +export { ScrollArea, ScrollBar }; diff --git a/src/components/ui/separator.tsx b/src/components/ui/separator.tsx index 12d81c4..9ac3b95 100644 --- a/src/components/ui/separator.tsx +++ b/src/components/ui/separator.tsx @@ -1,9 +1,9 @@ -"use client" +"use client"; -import * as React from "react" -import * as SeparatorPrimitive from "@radix-ui/react-separator" +import * as React from "react"; +import * as SeparatorPrimitive from "@radix-ui/react-separator"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; const Separator = React.forwardRef< React.ElementRef, @@ -11,7 +11,7 @@ const Separator = React.forwardRef< >( ( { className, orientation = "horizontal", decorative = true, ...props }, - ref + ref, ) => ( - ) -) -Separator.displayName = SeparatorPrimitive.Root.displayName + ), +); +Separator.displayName = SeparatorPrimitive.Root.displayName; -export { Separator } +export { Separator }; diff --git a/src/components/ui/single-form.tsx b/src/components/ui/single-form.tsx index 50c7f53..025d88b 100644 --- a/src/components/ui/single-form.tsx +++ b/src/components/ui/single-form.tsx @@ -1,26 +1,25 @@ -'use client'; +"use client"; - -import React from 'react'; -import * as Form from '@radix-ui/react-form'; +import React from "react"; +import * as Form from "@radix-ui/react-form"; interface SingleFormProps { - onSubmit: (event: React.FormEvent) => void; - fields: { name: string; label: string }[]; + onSubmit: (event: React.FormEvent) => void; + fields: { name: string; label: string }[]; } const SingleForm = ({ onSubmit, fields }: SingleFormProps) => { - return ( - - {fields.map((field) => ( - - {field.label} - - - ))} - Submit - - ); + return ( + + {fields.map((field) => ( + + {field.label} + + + ))} + Submit + + ); }; export default SingleForm; diff --git a/src/components/ui/skeleton.tsx b/src/components/ui/skeleton.tsx index 01b8b6d..2cdf440 100644 --- a/src/components/ui/skeleton.tsx +++ b/src/components/ui/skeleton.tsx @@ -1,4 +1,4 @@ -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; function Skeleton({ className, @@ -9,7 +9,7 @@ function Skeleton({ className={cn("animate-pulse rounded-md bg-muted", className)} {...props} /> - ) + ); } -export { Skeleton } +export { Skeleton }; diff --git a/src/components/ui/switch.tsx b/src/components/ui/switch.tsx index bc69cf2..b73edee 100644 --- a/src/components/ui/switch.tsx +++ b/src/components/ui/switch.tsx @@ -1,9 +1,9 @@ -"use client" +"use client"; -import * as React from "react" -import * as SwitchPrimitives from "@radix-ui/react-switch" +import * as React from "react"; +import * as SwitchPrimitives from "@radix-ui/react-switch"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; const Switch = React.forwardRef< React.ElementRef, @@ -12,18 +12,18 @@ const Switch = React.forwardRef< -)) -Switch.displayName = SwitchPrimitives.Root.displayName +)); +Switch.displayName = SwitchPrimitives.Root.displayName; -export { Switch } +export { Switch }; diff --git a/src/components/ui/table.tsx b/src/components/ui/table.tsx index 7f3502f..73cf6b4 100644 --- a/src/components/ui/table.tsx +++ b/src/components/ui/table.tsx @@ -1,6 +1,6 @@ -import * as React from "react" +import * as React from "react"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; const Table = React.forwardRef< HTMLTableElement, @@ -13,16 +13,16 @@ const Table = React.forwardRef< {...props} />
-)) -Table.displayName = "Table" +)); +Table.displayName = "Table"; const TableHeader = React.forwardRef< HTMLTableSectionElement, React.HTMLAttributes >(({ className, ...props }, ref) => ( -)) -TableHeader.displayName = "TableHeader" +)); +TableHeader.displayName = "TableHeader"; const TableBody = React.forwardRef< HTMLTableSectionElement, @@ -33,8 +33,8 @@ const TableBody = React.forwardRef< className={cn("[&_tr:last-child]:border-0", className)} {...props} /> -)) -TableBody.displayName = "TableBody" +)); +TableBody.displayName = "TableBody"; const TableFooter = React.forwardRef< HTMLTableSectionElement, @@ -44,12 +44,12 @@ const TableFooter = React.forwardRef< ref={ref} className={cn( "border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", - className + className, )} {...props} /> -)) -TableFooter.displayName = "TableFooter" +)); +TableFooter.displayName = "TableFooter"; const TableRow = React.forwardRef< HTMLTableRowElement, @@ -59,12 +59,12 @@ const TableRow = React.forwardRef< ref={ref} className={cn( "border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted", - className + className, )} {...props} /> -)) -TableRow.displayName = "TableRow" +)); +TableRow.displayName = "TableRow"; const TableHead = React.forwardRef< HTMLTableCellElement, @@ -74,12 +74,12 @@ const TableHead = React.forwardRef< ref={ref} className={cn( "h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0", - className + className, )} {...props} /> -)) -TableHead.displayName = "TableHead" +)); +TableHead.displayName = "TableHead"; const TableCell = React.forwardRef< HTMLTableCellElement, @@ -90,8 +90,8 @@ const TableCell = React.forwardRef< className={cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className)} {...props} /> -)) -TableCell.displayName = "TableCell" +)); +TableCell.displayName = "TableCell"; const TableCaption = React.forwardRef< HTMLTableCaptionElement, @@ -102,8 +102,8 @@ const TableCaption = React.forwardRef< className={cn("mt-4 text-sm text-muted-foreground", className)} {...props} /> -)) -TableCaption.displayName = "TableCaption" +)); +TableCaption.displayName = "TableCaption"; export { Table, @@ -114,4 +114,4 @@ export { TableRow, TableCell, TableCaption, -} +}; diff --git a/src/components/ui/textarea.tsx b/src/components/ui/textarea.tsx index 9f9a6dc..9f00573 100644 --- a/src/components/ui/textarea.tsx +++ b/src/components/ui/textarea.tsx @@ -1,6 +1,6 @@ -import * as React from "react" +import * as React from "react"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; export interface TextareaProps extends React.TextareaHTMLAttributes {} @@ -11,14 +11,14 @@ const Textarea = React.forwardRef(