-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(dashboard): SelectionLink for listed item page redirects
- Loading branch information
Showing
3 changed files
with
42 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { WfSpecData } from '@/types' | ||
import LinkWithTenant from './LinkWithTenant' | ||
|
||
import { Fragment } from 'react' | ||
import { TagIcon } from 'lucide-react' | ||
import { Separator } from '@/components/ui/separator' | ||
|
||
export const SelectionLink = ({ | ||
href, | ||
key, | ||
children, | ||
...props | ||
}: { href: string | undefined } & Omit<React.ComponentProps<typeof LinkWithTenant>, 'href'>) => { | ||
return href !== undefined ? ( | ||
<Fragment key={key}> | ||
<LinkWithTenant | ||
className="flex items-center gap-3 rounded-md px-2 py-2 hover:bg-gray-100" | ||
href={href} | ||
linkStyle={href !== undefined} | ||
{...props} | ||
> | ||
{children} | ||
</LinkWithTenant> | ||
<Separator /> | ||
</Fragment> | ||
) : ( | ||
<Fragment key={key}> | ||
<div className="flex items-center gap-3 rounded-md px-2 py-2 hover:bg-gray-100">{children}</div> | ||
<Separator /> | ||
</Fragment> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters