File tree Expand file tree Collapse file tree 5 files changed +17
-10
lines changed
app/workspace/[workspaceId]
settings/components/admin
components/emcn/components Expand file tree Collapse file tree 5 files changed +17
-10
lines changed Original file line number Diff line number Diff line change 22
33import { useState } from 'react'
44import { Banner } from '@/components/emcn'
5- import { useStopImpersonating } from '@/hooks/queries/admin-users'
65import { useSession } from '@/lib/auth/auth-client'
6+ import { useStopImpersonating } from '@/hooks/queries/admin-users'
77
88function getImpersonationBannerText ( userLabel : string , userEmail ?: string ) {
99 return `Impersonating ${ userLabel } ${ userEmail ? ` (${ userEmail } )` : '' } . Changes will apply to this account until you switch back.`
@@ -25,7 +25,9 @@ export function ImpersonationBanner() {
2525 variant = 'destructive'
2626 text = { getImpersonationBannerText ( userLabel , userEmail ) }
2727 textClassName = 'text-red-700 dark:text-red-300'
28- actionLabel = { stopImpersonating . isPending || isRedirecting ? 'Returning...' : 'Stop impersonating' }
28+ actionLabel = {
29+ stopImpersonating . isPending || isRedirecting ? 'Returning...' : 'Stop impersonating'
30+ }
2931 actionVariant = 'destructive'
3032 actionDisabled = { stopImpersonating . isPending || isRedirecting }
3133 onAction = { ( ) =>
Original file line number Diff line number Diff line change 11import { ToastProvider } from '@/components/emcn'
2- import { GlobalCommandsProvider } from '@/app/workspace/[workspaceId]/providers/global-commands-provider'
32import { ImpersonationBanner } from '@/app/workspace/[workspaceId]/impersonation-banner'
3+ import { GlobalCommandsProvider } from '@/app/workspace/[workspaceId]/providers/global-commands-provider'
44import { ProviderModelsLoader } from '@/app/workspace/[workspaceId]/providers/provider-models-loader'
55import { SettingsLoader } from '@/app/workspace/[workspaceId]/providers/settings-loader'
66import { WorkspacePermissionsProvider } from '@/app/workspace/[workspaceId]/providers/workspace-permissions-provider'
Original file line number Diff line number Diff line change @@ -254,10 +254,10 @@ export function Admin() {
254254 onClick = { ( ) => handleImpersonate ( u . id ) }
255255 disabled = { pendingUserIds . has ( u . id ) }
256256 >
257- { ( impersonatingUserId === u . id ||
258- ( impersonateUser . isPending &&
259- ( impersonateUser . variables as { userId ?: string } | undefined )
260- ?. userId === u . id ) )
257+ { impersonatingUserId === u . id ||
258+ ( impersonateUser . isPending &&
259+ ( impersonateUser . variables as { userId ?: string } | undefined )
260+ ?. userId === u . id )
261261 ? 'Switching...'
262262 : 'Impersonate' }
263263 </ Button >
Original file line number Diff line number Diff line change 22
33import type { HTMLAttributes , ReactNode } from 'react'
44import { cva , type VariantProps } from 'class-variance-authority'
5- import { cn } from '@/lib/core/utils/cn'
65import { Button , type ButtonProps } from '@/components/emcn/components/button/button'
6+ import { cn } from '@/lib/core/utils/cn'
77
88const bannerVariants = cva ( 'shrink-0 px-[24px] py-[10px]' , {
99 variants : {
@@ -50,7 +50,12 @@ export function Banner({
5050 return (
5151 < div className = { cn ( bannerVariants ( { variant } ) , className ) } { ...props } >
5252 { children ?? (
53- < div className = { cn ( 'mx-auto flex max-w-[1400px] items-center justify-between gap-[12px]' , contentClassName ) } >
53+ < div
54+ className = { cn (
55+ 'mx-auto flex max-w-[1400px] items-center justify-between gap-[12px]' ,
56+ contentClassName
57+ ) }
58+ >
5459 < p className = { cn ( 'text-[13px]' , textClassName ) } > { text } </ p >
5560 { actionLabel ? (
5661 < Button
Original file line number Diff line number Diff line change 66 avatarStatusVariants ,
77 avatarVariants ,
88} from './avatar/avatar'
9- export { Banner , type BannerProps } from './banner/banner'
109export { Badge } from './badge/badge'
10+ export { Banner , type BannerProps } from './banner/banner'
1111export { Breadcrumb , type BreadcrumbItem , type BreadcrumbProps } from './breadcrumb/breadcrumb'
1212export { Button , type ButtonProps , buttonVariants } from './button/button'
1313export {
You can’t perform that action at this time.
0 commit comments