Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
indaviande committed Dec 16, 2024
1 parent 86391fb commit 6c0124c
Showing 1 changed file with 32 additions and 26 deletions.
58 changes: 32 additions & 26 deletions src/components/primitives/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

import { Link, useLocation } from "@remix-run/react";

import { type ReactNode } from "react";
import type { ReactNode } from "react";
import { type VariantProps, tv } from "tailwind-variants";
import { Container } from "../..";
import useThemableProps from "../../hooks/theming/useThemableProps";
Expand Down Expand Up @@ -147,32 +147,38 @@ export default function Tabs({ look, size, to, theme, className, tabs = [], ...p
<Container>
<Group className={mergeClass(line(), "gap-xl*2 items-center w-full")}>
{tabs.map(tab => {
const relativeUrl = tab.link.split("?")[0];
const relativeUrl = tab.link.split("?")[0];

return (
<>
{tab.link ? (
<EventBlocker key={tab.key}>
<Link
to={tab.link}
style={themeVars}
className={mergeClass(styleProps, base(), className, location.pathname === relativeUrl && active())}>
{tab.label}
</Link>
</EventBlocker>
) : (
<button
key={tab.key}
style={themeVars}
className={mergeClass(styleProps, base(), className, location.pathname === relativeUrl && active())}
type="button"
{...props}>
{tab.label}
</button>
)}
</>
);
})}</Group>
return (
<>
{tab.link ? (
<EventBlocker key={tab.key}>
<Link
to={tab.link}
style={themeVars}
className={mergeClass(
styleProps,
base(),
className,
location.pathname === relativeUrl && active(),
)}>
{tab.label}
</Link>
</EventBlocker>
) : (
<button
key={tab.key}
style={themeVars}
className={mergeClass(styleProps, base(), className, location.pathname === relativeUrl && active())}
type="button"
{...props}>
{tab.label}
</button>
)}
</>
);
})}
</Group>
</Container>
</Group>
);
Expand Down

0 comments on commit 6c0124c

Please sign in to comment.