diff --git a/apps/analytics-web/app/_actions/actions.ts b/apps/analytics-web/app/_actions/actions.ts index 3b2a13eb..aeff3e93 100644 --- a/apps/analytics-web/app/_actions/actions.ts +++ b/apps/analytics-web/app/_actions/actions.ts @@ -11,6 +11,7 @@ export async function getEvents() { return events; } catch (error) { + console.error("Error getting events", error); return []; } } @@ -24,6 +25,7 @@ export async function insertEvent(event: EventInsertType) { return { data: insertedEvent, error: null }; } catch (error) { + console.error("Error inserting events", error); return { data: null, error: "Error inserting events" }; } } diff --git a/apps/analytics-web/app/_components/analytics/EventsTable/EventsTable.tsx b/apps/analytics-web/app/_components/analytics/EventsTable/EventsTable.tsx index 6b63d76f..dfa01d48 100644 --- a/apps/analytics-web/app/_components/analytics/EventsTable/EventsTable.tsx +++ b/apps/analytics-web/app/_components/analytics/EventsTable/EventsTable.tsx @@ -44,13 +44,13 @@ export default function EventsTable() {

Events

- {events.length === 0 &&

Loading...

} + {!events.length &&

Loading...

}
- {events.length > 0 && } + {!!events.length && }
- {events.length > 0 && ( + {!!events.length && ( )}
diff --git a/apps/analytics-web/app/_components/analytics/EventsTable/TableFilter.tsx b/apps/analytics-web/app/_components/analytics/EventsTable/TableFilter.tsx index 61e35a6e..80148497 100644 --- a/apps/analytics-web/app/_components/analytics/EventsTable/TableFilter.tsx +++ b/apps/analytics-web/app/_components/analytics/EventsTable/TableFilter.tsx @@ -32,7 +32,7 @@ const TableFilter = ({ eventTypes, setEventTypes }: TableFilterProps) => { return ( - + @@ -43,7 +43,7 @@ const TableFilter = ({ eventTypes, setEventTypes }: TableFilterProps) => {
- + ); } diff --git a/apps/analytics-web/components/DataTable/column-header.tsx b/apps/analytics-web/components/DataTable/column-header.tsx index afb0f260..0d6d74b7 100644 --- a/apps/analytics-web/components/DataTable/column-header.tsx +++ b/apps/analytics-web/components/DataTable/column-header.tsx @@ -27,7 +27,7 @@ export function DataTableColumnHeader({ return (
- + diff --git a/apps/analytics-web/components/ExportButton.tsx b/apps/analytics-web/components/ExportButton.tsx index 63f66230..b834a9d0 100644 --- a/apps/analytics-web/components/ExportButton.tsx +++ b/apps/analytics-web/components/ExportButton.tsx @@ -10,8 +10,8 @@ type ExportButtonProps = { filename: string; }; -export const ExportButton: React.FC = ({ data, filename }) => { - const handleExportCsv = () => { +const ExportButton: React.FC = ({ data, filename }) => { + const handleExportCSV = () => { const csvData = Papa.unparse(data); const blob = new Blob([csvData], { type: "text/csv;charset=utf-8;" }); @@ -29,8 +29,10 @@ export const ExportButton: React.FC = ({ data, filename }) => }; return ( - ); }; + +export default ExportButton; diff --git a/apps/analytics-web/components/ui/button.tsx b/apps/analytics-web/components/ui/button.tsx index 04a05e21..b21dc584 100644 --- a/apps/analytics-web/components/ui/button.tsx +++ b/apps/analytics-web/components/ui/button.tsx @@ -1,6 +1,6 @@ import { Slot } from "@radix-ui/react-slot"; import { type VariantProps, cva } from "class-variance-authority"; -import { forwardRef } from "react"; +import * as React from "react"; import { cn } from "~/utils/shadcn"; @@ -35,7 +35,7 @@ export type ButtonProps = { } & React.ButtonHTMLAttributes & VariantProps; -const Button = forwardRef( +const Button = React.forwardRef( ({ className, variant, size, asChild = false, ...props }, ref) => { const Comp = asChild ? Slot : "button"; return ; diff --git a/apps/analytics-web/components/ui/card.tsx b/apps/analytics-web/components/ui/card.tsx index 5a582fd5..b4d70925 100644 --- a/apps/analytics-web/components/ui/card.tsx +++ b/apps/analytics-web/components/ui/card.tsx @@ -42,4 +42,4 @@ const CardFooter = React.forwardRef import * as DialogPrimitive from "@radix-ui/react-dialog"; import { X } from "lucide-react"; -import { forwardRef, type ComponentPropsWithoutRef, type ElementRef, type HTMLAttributes } from "react"; +import * as React from "react"; import { cn } from "~/utils/shadcn"; @@ -15,9 +14,9 @@ const DialogPortal = DialogPrimitive.Portal; const DialogClose = DialogPrimitive.Close; -const DialogOverlay = forwardRef< - ElementRef, - ComponentPropsWithoutRef +const DialogOverlay = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( , - ComponentPropsWithoutRef +const DialogContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, children, ...props }, ref) => ( @@ -54,19 +53,19 @@ const DialogContent = forwardRef< )); DialogContent.displayName = DialogPrimitive.Content.displayName; -const DialogHeader = ({ className, ...props }: HTMLAttributes) => ( +const DialogHeader = ({ className, ...props }: React.HTMLAttributes) => (
); DialogHeader.displayName = "DialogHeader"; -const DialogFooter = ({ className, ...props }: HTMLAttributes) => ( +const DialogFooter = ({ className, ...props }: React.HTMLAttributes) => (
); DialogFooter.displayName = "DialogFooter"; -const DialogTitle = forwardRef< - ElementRef, - ComponentPropsWithoutRef +const DialogTitle = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( , - ComponentPropsWithoutRef +const DialogDescription = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( )); @@ -86,13 +85,13 @@ DialogDescription.displayName = DialogPrimitive.Description.displayName; export { Dialog, + DialogPortal, + DialogOverlay, DialogClose, + DialogTrigger, DialogContent, - DialogDescription, - DialogFooter, DialogHeader, - DialogOverlay, - DialogPortal, + DialogFooter, DialogTitle, - DialogTrigger, + DialogDescription, }; diff --git a/apps/analytics-web/components/ui/dropdown-menu.tsx b/apps/analytics-web/components/ui/dropdown-menu.tsx index 9440a526..bcbe2113 100644 --- a/apps/analytics-web/components/ui/dropdown-menu.tsx +++ b/apps/analytics-web/components/ui/dropdown-menu.tsx @@ -1,9 +1,8 @@ "use client"; -// biome-ignore lint/style/noNamespaceImport: Correct for radix primitive import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"; import { Check, ChevronRight, Circle } from "lucide-react"; -import { forwardRef, type ComponentPropsWithoutRef, type ElementRef, type HTMLAttributes } from "react"; +import * as React from "react"; import { cn } from "~/utils/shadcn"; @@ -19,9 +18,9 @@ const DropdownMenuSub = DropdownMenuPrimitive.Sub; const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup; -const DropdownMenuSubTrigger = forwardRef< - ElementRef, - ComponentPropsWithoutRef & { +const DropdownMenuSubTrigger = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef & { inset?: boolean; } >(({ className, inset, children, ...props }, ref) => ( @@ -40,9 +39,9 @@ const DropdownMenuSubTrigger = forwardRef< )); DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName; -const DropdownMenuSubContent = forwardRef< - ElementRef, - ComponentPropsWithoutRef +const DropdownMenuSubContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( , - ComponentPropsWithoutRef +const DropdownMenuContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, sideOffset = 4, ...props }, ref) => ( , - ComponentPropsWithoutRef & { +const DropdownMenuItem = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef & { inset?: boolean; } >(({ className, inset, ...props }, ref) => ( @@ -91,9 +90,9 @@ const DropdownMenuItem = forwardRef< )); DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName; -const DropdownMenuCheckboxItem = forwardRef< - ElementRef, - ComponentPropsWithoutRef +const DropdownMenuCheckboxItem = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, children, checked, ...props }, ref) => ( , - ComponentPropsWithoutRef +const DropdownMenuRadioItem = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, children, ...props }, ref) => ( , - ComponentPropsWithoutRef & { +const DropdownMenuLabel = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef & { inset?: boolean; } >(({ className, inset, ...props }, ref) => ( @@ -150,33 +149,33 @@ const DropdownMenuLabel = forwardRef< )); DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName; -const DropdownMenuSeparator = forwardRef< - ElementRef, - ComponentPropsWithoutRef +const DropdownMenuSeparator = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( )); DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName; -const DropdownMenuShortcut = ({ className, ...props }: HTMLAttributes) => { +const DropdownMenuShortcut = ({ className, ...props }: React.HTMLAttributes) => { return ; }; DropdownMenuShortcut.displayName = "DropdownMenuShortcut"; export { DropdownMenu, - DropdownMenuCheckboxItem, + DropdownMenuTrigger, DropdownMenuContent, - DropdownMenuGroup, DropdownMenuItem, - DropdownMenuLabel, - DropdownMenuPortal, - DropdownMenuRadioGroup, + DropdownMenuCheckboxItem, DropdownMenuRadioItem, + DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, + DropdownMenuGroup, + DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, - DropdownMenuTrigger, + DropdownMenuRadioGroup, }; diff --git a/apps/analytics-web/components/ui/select.tsx b/apps/analytics-web/components/ui/select.tsx index 71f2f7d0..e433e3b2 100644 --- a/apps/analytics-web/components/ui/select.tsx +++ b/apps/analytics-web/components/ui/select.tsx @@ -25,7 +25,7 @@ const SelectTrigger = React.forwardRef< {...props} > {children} - + @@ -101,4 +101,4 @@ const SelectSeparator = React.forwardRef< )); SelectSeparator.displayName = SelectPrimitive.Separator.displayName; -export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue }; +export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator }; diff --git a/apps/analytics-web/components/ui/switch.tsx b/apps/analytics-web/components/ui/switch.tsx index 44666526..a0907779 100644 --- a/apps/analytics-web/components/ui/switch.tsx +++ b/apps/analytics-web/components/ui/switch.tsx @@ -1,14 +1,13 @@ "use client"; -// biome-ignore lint/style/noNamespaceImport: import * as SwitchPrimitives from "@radix-ui/react-switch"; -import { forwardRef, type ComponentPropsWithoutRef, type ElementRef } from "react"; +import * as React from "react"; import { cn } from "~/utils/shadcn"; -const Switch = forwardRef< - ElementRef, - ComponentPropsWithoutRef +const Switch = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( , ComponentPropsWithoutRef>( - ({ className, ...props }, ref) => ( - - ), -); +const TabsList = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)); TabsList.displayName = TabsPrimitive.List.displayName; -const TabsTrigger = forwardRef< - ElementRef, - ComponentPropsWithoutRef +const TabsTrigger = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( , - ComponentPropsWithoutRef +const TabsContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - console.error(error); - process.exit(1); + console.error("Error seeding events", error); } process.exit(); diff --git a/apps/documentation/app/[locale]/[project]/[...docPath]/page.tsx b/apps/documentation/app/[locale]/[project]/[...docPath]/page.tsx index f8243eb4..89ce4066 100644 --- a/apps/documentation/app/[locale]/[project]/[...docPath]/page.tsx +++ b/apps/documentation/app/[locale]/[project]/[...docPath]/page.tsx @@ -46,9 +46,7 @@ export default async function Page({ params }: { params: PageParams }) { pathSegment: docPath, }); - if (document === null) { - notFound(); - } + if (document === null) notFound(); return (
locale !== currentLocale); - if (supportedLanguages.length === 0) { - return null; - } + if (!supportedLanguages.length) return null; return (
diff --git a/apps/documentation/app/[locale]/[project]/page.tsx b/apps/documentation/app/[locale]/[project]/page.tsx index 924382c8..ea4c6d18 100644 --- a/apps/documentation/app/[locale]/[project]/page.tsx +++ b/apps/documentation/app/[locale]/[project]/page.tsx @@ -17,9 +17,7 @@ export default async function Page({ params }: PageProps) { project, }); - if (document === null) { - notFound(); - } + if (document === null) notFound(); return (
cur === locale); - if (!isValidLocale) { - notFound(); - } + if (!isValidLocale) notFound(); // setting setRequestLocale to support next-intl for static rendering setRequestLocale(locale); @@ -65,12 +64,12 @@ export default async function MainLayout({ children, params: { locale } }: MainL } return ( - + - + {children} - + diff --git a/apps/documentation/app/icon.svg b/apps/documentation/app/icon.svg index 52f50a5b..f19819df 100644 --- a/apps/documentation/app/icon.svg +++ b/apps/documentation/app/icon.svg @@ -12,12 +12,12 @@ .st6{fill:#0FA3CF;} .st7{fill:#13B3E2;} - - - - - - - - + + + + + + + + diff --git a/apps/documentation/app/not-found.tsx b/apps/documentation/app/not-found.tsx index a6b7634a..67fbc611 100644 --- a/apps/documentation/app/not-found.tsx +++ b/apps/documentation/app/not-found.tsx @@ -13,7 +13,7 @@ const quicksand = Quicksand({ export default function NotFound() { return ( - +
404 - Not found diff --git a/apps/documentation/components/DocSearchComponent.tsx b/apps/documentation/components/DocSearchComponent.tsx index cb842c65..87de1f36 100644 --- a/apps/documentation/components/DocSearchComponent.tsx +++ b/apps/documentation/components/DocSearchComponent.tsx @@ -1,10 +1,10 @@ "use client"; -import { inputVariants } from "@codaco/ui"; -import "@docsearch/css"; import { DocSearch } from "@docsearch/react"; -import { Search } from "lucide-react"; import { useLocale, useTranslations } from "next-intl"; +import "@docsearch/css"; +import { inputVariants } from "@codaco/ui"; +import { Search } from "lucide-react"; import { env } from "~/env"; import { cn } from "~/lib/utils"; diff --git a/apps/documentation/components/Hero.tsx b/apps/documentation/components/Hero.tsx index 7ac9240a..27a4b6a7 100644 --- a/apps/documentation/components/Hero.tsx +++ b/apps/documentation/components/Hero.tsx @@ -58,7 +58,7 @@ export function Hero() { {t("Hero.title")} {t("Hero.tagline")} - +
{resolvedTheme !== "dark" && (
diff --git a/apps/documentation/components/ProjectSwitcher.tsx b/apps/documentation/components/ProjectSwitcher.tsx index 94c8a9e1..e614c5d6 100644 --- a/apps/documentation/components/ProjectSwitcher.tsx +++ b/apps/documentation/components/ProjectSwitcher.tsx @@ -68,7 +68,7 @@ export default function ProjectSwitcher() { {projects.map((p) => ( - + ))} diff --git a/apps/documentation/components/SharedNav/Menu.tsx b/apps/documentation/components/SharedNav/Menu.tsx index c0be451d..b17b6c3e 100644 --- a/apps/documentation/components/SharedNav/Menu.tsx +++ b/apps/documentation/components/SharedNav/Menu.tsx @@ -54,7 +54,7 @@ export const NavigationMenuDemo = () => { const t = useTranslations("SharedNavigation"); return ( - + @@ -153,7 +143,7 @@ const SidebarFolder = ({ @@ -202,7 +192,7 @@ const SidebarLink = ({ }; const renderSidebarItem = ( - item: tSidebarFolder | SidebarPage, + item: TSidebarFolder | SidebarPage, locale: Locale, sidebarContainerRef: RefObject, ) => { diff --git a/apps/documentation/components/TableOfContents.tsx b/apps/documentation/components/TableOfContents.tsx index 36e5ae48..b01c5711 100644 --- a/apps/documentation/components/TableOfContents.tsx +++ b/apps/documentation/components/TableOfContents.tsx @@ -7,7 +7,7 @@ import useHighlighted from "~/hooks/useHighlighted"; import type { HeadingNode } from "~/lib/tableOfContents"; import { cn } from "~/lib/utils"; -const tocLink = ({ +const TOCLink = ({ node, sideBar, }: { @@ -18,9 +18,7 @@ const tocLink = ({ const [highlighted] = useHighlighted(node.id); useEffect(() => { - if (!sideBar) { - return; - } + if (!sideBar) return; if (highlighted && ref.current) { ref.current.scrollIntoView({ @@ -75,7 +73,7 @@ function renderNodes(nodes: HeadingNode[], sideBar: boolean) {
    {nodes.map((node) => (
  1. - + {node.children?.length > 0 && renderNodes(node.children, sideBar)}
  2. ))} diff --git a/apps/documentation/components/ai-assistant.tsx b/apps/documentation/components/ai-assistant.tsx index db4b644f..9fdf8e2d 100644 --- a/apps/documentation/components/ai-assistant.tsx +++ b/apps/documentation/components/ai-assistant.tsx @@ -41,7 +41,7 @@ const TriggerButton = () => { return ( - + } {content}
- {showToc && } + {showToc && } ); } diff --git a/apps/documentation/components/customComponents/CodeCopyButton.tsx b/apps/documentation/components/customComponents/CodeCopyButton.tsx index 85fba26d..06d9a5b7 100644 --- a/apps/documentation/components/customComponents/CodeCopyButton.tsx +++ b/apps/documentation/components/customComponents/CodeCopyButton.tsx @@ -13,13 +13,15 @@ const CodeCopyButton = ({ code }: { code: string }) => { await navigator.clipboard.writeText(text); setIsCopied(true); setTimeout(() => setIsCopied(false), 2000); // Reset state after 2 seconds - } catch (error) {} + } catch (error) { + console.error("Failed to copy to clipboard:", error); + } }; return (
- - + + {isCopied ? (