mirror of
https://github.com/supabase/supabase.git
synced 2026-05-10 10:50:18 -04:00
9318404e61
* first pass * init * updated types * fix up key reveal * Update QuickKeyCopy.tsx * remove quick key copy * api key pill now only allows reveal and copy if you have perm * Update LegacyAPIKeys.tsx * fix up layouts * fix copy * Fix action menu dropdown position, few small nudges * Remove unused files. * Remove the hardcoded and rename the feature flag for basic API keys. * add support for name and description, some smaller improvements * Fix the trims for the description. --------- Co-authored-by: Terry Sutton <saltcod@gmail.com> Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com> Co-authored-by: Stojan Dimitrovski <sdimitrovski@gmail.com>
39 lines
1007 B
TypeScript
39 lines
1007 B
TypeScript
import React, { forwardRef } from 'react'
|
|
import { cn } from 'ui'
|
|
|
|
interface DisableInteractionProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
disabled?: boolean
|
|
}
|
|
|
|
/**
|
|
* DisableInteraction component
|
|
*
|
|
* A utility component that wraps content and prevents all user interactions when disabled
|
|
* including clicking, hovering, and text selection.
|
|
*
|
|
* @example
|
|
* <DisableInteraction disabled={isDisabled}>
|
|
* <YourContent />
|
|
* </DisableInteraction>
|
|
*/
|
|
export const DisableInteraction = forwardRef<HTMLDivElement, DisableInteractionProps>(
|
|
({ disabled, style, className, ...props }, ref) => (
|
|
<div
|
|
ref={ref}
|
|
{...props}
|
|
className={cn(disabled && 'opacity-50 pointer-events-none', className)}
|
|
style={{
|
|
...(disabled && {
|
|
userSelect: 'none',
|
|
WebkitUserSelect: 'none',
|
|
MozUserSelect: 'none',
|
|
msUserSelect: 'none',
|
|
}),
|
|
...style,
|
|
}}
|
|
/>
|
|
)
|
|
)
|
|
|
|
DisableInteraction.displayName = 'DisableInteraction'
|