diff --git a/src/routes/-components/auth/header/app-navigation.tsx b/src/routes/-components/auth/header/app-navigation.tsx index 2f8a29c6..d185e25f 100644 --- a/src/routes/-components/auth/header/app-navigation.tsx +++ b/src/routes/-components/auth/header/app-navigation.tsx @@ -1,18 +1,10 @@ import React from "react"; -import { - Link, - type AnyRouter, - type LinkProps, - type RegisteredRouter, - type RoutePaths, -} from "@tanstack/react-router"; +import { Link, type LinkProps } from "@tanstack/react-router"; import { useLocalStorage } from "@/lib/hooks/useLocalStorage"; import { STORAGE_DEFAULTS, STORAGE_KEYS } from "@/lib/utils/constants"; -import type { LinkComponentProps } from "@/lib/types/router"; - import { cn } from "@/lib/utils"; const defaultActiveOptions: LinkProps["activeOptions"] = { @@ -116,17 +108,7 @@ export const AppNavigation = (props: Props) => { ); }; -const AppNavigationLink = < - TRouter extends AnyRouter = RegisteredRouter, - TFrom extends RoutePaths | string = string, - TTo extends string = "", - TMaskFrom extends RoutePaths | string = TFrom, - TMaskTo extends string = "", ->(props: { - name: string; - props: LinkProps & - LinkComponentProps<"a">; -}) => { +const AppNavigationLink = (props: { name: string; props: LinkProps }) => { const { name, props: linkProps } = props; return (
  • diff --git a/src/routes/_auth/(agreements)/agreements.$agreementId._details.summary.tsx b/src/routes/_auth/(agreements)/agreements.$agreementId._details.summary.tsx index a123b125..9083df57 100644 --- a/src/routes/_auth/(agreements)/agreements.$agreementId._details.summary.tsx +++ b/src/routes/_auth/(agreements)/agreements.$agreementId._details.summary.tsx @@ -196,6 +196,7 @@ function Component() { asChild > ({ ...s, summary_tab: tab.id })} resetScroll={false} > diff --git a/src/routes/_auth/(dashboard)/-components/stats-block-display.tsx b/src/routes/_auth/(dashboard)/-components/stats-block-display.tsx index 105fbeba..67f6a819 100644 --- a/src/routes/_auth/(dashboard)/-components/stats-block-display.tsx +++ b/src/routes/_auth/(dashboard)/-components/stats-block-display.tsx @@ -1,11 +1,5 @@ import React from "react"; -import { - Link, - type AnyRouter, - type LinkProps, - type RegisteredRouter, - type RoutePaths, -} from "@tanstack/react-router"; +import { Link, type LinkProps } from "@tanstack/react-router"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { icons, type LucideIcon } from "@/components/ui/icons"; @@ -18,8 +12,6 @@ import type { TDashboardStats } from "@/lib/schemas/dashboard"; import { STORAGE_DEFAULTS, STORAGE_KEYS } from "@/lib/utils/constants"; import { localDateToQueryYearMonthDay } from "@/lib/utils/date"; -import type { LinkComponentProps } from "@/lib/types/router"; - function formatDisplayValue(value: number | null | undefined): string | null { if (typeof value === "undefined") return null; return Number(value ?? 0).toString(); @@ -137,18 +129,11 @@ const DashboardStatsBlock = ({ ); }; -const StatBlock = < - TRouter extends AnyRouter = RegisteredRouter, - TFrom extends RoutePaths | string = string, - TTo extends string = "", - TMaskFrom extends RoutePaths | string = TFrom, - TMaskTo extends string = "", ->(props: { +const StatBlock = (props: { title: string; value: string | null; icon: LucideIcon; - linkProps: LinkProps & - LinkComponentProps<"a">; + linkProps: LinkProps; }) => { const { title, value, icon: Icon, linkProps } = props; diff --git a/src/routes/_auth/(settings)/-components/sub-page-nav-item.tsx b/src/routes/_auth/(settings)/-components/sub-page-nav-item.tsx index 4146bf5b..cde82e01 100644 --- a/src/routes/_auth/(settings)/-components/sub-page-nav-item.tsx +++ b/src/routes/_auth/(settings)/-components/sub-page-nav-item.tsx @@ -1,31 +1,16 @@ import * as React from "react"; -import { - Link, - type AnyRouter, - type LinkProps, - type RegisteredRouter, - type RoutePaths, -} from "@tanstack/react-router"; +import { Link, type LinkProps } from "@tanstack/react-router"; import { useTranslation } from "react-i18next"; import { buttonVariants } from "@/components/ui/button"; import { icons } from "@/components/ui/icons"; -import type { LinkComponentProps } from "@/lib/types/router"; - import { cn } from "@/lib/utils"; -export function SubPageNavItem< - TRouter extends AnyRouter = RegisteredRouter, - TFrom extends RoutePaths | string = string, - TTo extends string = "", - TMaskFrom extends RoutePaths | string = TFrom, - TMaskTo extends string = "", ->(props: { +export function SubPageNavItem(props: { title: string; description: string; - link: LinkProps & - LinkComponentProps<"a">; + link: LinkProps; }) { const { title, description, link } = props; const { t } = useTranslation(); diff --git a/src/routes/_auth/-modules/summary/common.tsx b/src/routes/_auth/-modules/summary/common.tsx index 2c7bbee2..f88e896a 100644 --- a/src/routes/_auth/-modules/summary/common.tsx +++ b/src/routes/_auth/-modules/summary/common.tsx @@ -1,11 +1,5 @@ import * as React from "react"; -import { - Link, - type AnyRouter, - type LinkProps, - type RegisteredRouter, - type RoutePaths, -} from "@tanstack/react-router"; +import { Link, type LinkProps } from "@tanstack/react-router"; import { cva, type VariantProps } from "class-variance-authority"; import { @@ -16,8 +10,6 @@ import { } from "@/components/ui/accordion"; import { CardHeader, CardTitle } from "@/components/ui/card"; -import type { LinkComponentProps } from "@/lib/types/router"; - import { cn } from "@/lib/utils"; export const SummaryHeader = ({ @@ -75,29 +67,17 @@ const accordionValueVariants = cva("font-semibold", { }, }); -interface SummaryLineItemProps< - TRouter extends AnyRouter = RegisteredRouter, - TFrom extends RoutePaths | string = string, - TTo extends string = "", - TMaskFrom extends RoutePaths | string = TFrom, - TMaskTo extends string = "", -> extends VariantProps, +interface SummaryLineItemProps + extends VariantProps, VariantProps { label: string; value: React.ReactNode; initialDropdownExpanded?: boolean; children?: React.ReactNode | undefined; - linkOptions?: LinkProps & - LinkComponentProps<"a">; + linkOptions?: LinkProps; } -export function SummaryLineItem< - TRouter extends AnyRouter = RegisteredRouter, - TFrom extends RoutePaths | string = string, - TTo extends string = "", - TMaskFrom extends RoutePaths | string = TFrom, - TMaskTo extends string = "", ->(props: SummaryLineItemProps) { +export function SummaryLineItem(props: SummaryLineItemProps) { const { // main label,