Files
supabase/apps/studio/components/layouts/AppLayout/OrgCommandItem.tsx
Gildas Garcia 243e079a2c chore: remove _Shadcn_ suffix from Command components (#46153)
## Problem

The `_Shadcn_` suffix isn't needed anymore on `Command` components

## Solution

- Remove the `_Shadcn_` suffix
- Simplify UI package exports
- Apply prettier

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Refactor**
* Simplified command component imports and exports across the UI library
by removing internal naming aliases and adopting direct component
references. Updated the public UI package barrel export to use wildcard
re-exports for cleaner API surface.

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/supabase/supabase/pull/46153?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

<!-- review_stack_entry_end -->

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-05-20 15:45:32 +02:00

50 lines
1.2 KiB
TypeScript

import { Check } from 'lucide-react'
import Link from 'next/link'
import { cn, CommandItem } from 'ui'
import PartnerIcon from '@/components/ui/PartnerIcon'
import type { Organization } from '@/types'
export interface OrgCommandItemProps {
org: Organization
selectedSlug: string | undefined
routePathname: string
hasRouteSlug: boolean
onClose: () => void
compactPadding?: boolean
}
export function OrgCommandItem({
org,
selectedSlug,
routePathname,
hasRouteSlug,
onClose,
compactPadding = false,
}: OrgCommandItemProps) {
const href = hasRouteSlug ? routePathname.replace('[slug]', org.slug) : `/org/${org.slug}`
return (
<CommandItem
key={org.slug}
value={`${org.name.replaceAll('"', '')} - ${org.slug}`}
className="cursor-pointer w-full"
onSelect={() => onClose()}
>
<Link
href={href}
className={cn(
'w-full flex items-center justify-between text-sm md:text-xs',
!compactPadding && 'p-0.5'
)}
>
<div className="flex items-center gap-2">
<span>{org.name}</span>
<PartnerIcon organization={org} />
</div>
{org.slug === selectedSlug && <Check size={16} />}
</Link>
</CommandItem>
)
}