import { forwardRef } from 'react'; import { Link, useLocation } from '@remix-run/react'; import { twMerge } from 'tailwind-merge'; import * as DropdownMenu from './DropdownMenu'; import type { ClientApp } from '../types'; import type { ElementRef, ComponentPropsWithRef, SVGAttributes } from 'react'; export const Root = DropdownMenu.Root; export const Trigger = DropdownMenu.Trigger; //this icon is no compatible with Button, IconButton thus it's private component of AppsDropdownMenu function PlusCirce(props: SVGAttributes) { return ( ); } type AppsDropdownMenuProps = ComponentPropsWithRef & { apps: ClientApp[]; children?: never; }; export const Content = forwardRef, AppsDropdownMenuProps>(function Content( { apps, className, ...other }, forwardedRef, ) { const { pathname } = useLocation(); return ( Create an app {pathname !== '/apps' && ( All apps )} {apps .filter(({ id }) => !pathname.includes(id)) .map(({ name, id }) => { return ( {name} ); })} ); });