mirror of
https://github.com/supabase/supabase.git
synced 2026-06-14 23:25:16 +08:00
This PR migrates the whole monorepo to use Tailwind v4: - Removed `@tailwindcss/container-queries` plugin since it's included by default in v4, - Bump all instances of Tailwind to v4. Made minimal changes to the shared config to remove non-supported features (`alpha` mentions), - Migrate all apps to be compatible with v4 configs, - Fix the `typography.css` import in 3 apps, - Add missing rules which were included by default in v3, - Run `pnpm dlx @tailwindcss/upgrade` on all apps, which renames a lot of classes - Rename all misnamed classes according to https://tailwindcss.com/docs/upgrade-guide#renamed-utilities in all apps. --------- Co-authored-by: Jordi Enric <jordi.err@gmail.com>
55 lines
1.8 KiB
TypeScript
55 lines
1.8 KiB
TypeScript
import { Check, Copy } from 'lucide-react'
|
|
import { useState } from 'react'
|
|
import { cn, copyToClipboard } from 'ui'
|
|
|
|
interface Parameter {
|
|
key: string
|
|
value: string
|
|
}
|
|
|
|
interface ConnectionParametersProps {
|
|
parameters: Parameter[]
|
|
onCopy?: (paramKey: string) => void
|
|
}
|
|
|
|
export const ConnectionParameters = ({ parameters, onCopy }: ConnectionParametersProps) => {
|
|
const [copiedMap, setCopiedMap] = useState<Record<string, boolean>>({})
|
|
|
|
return (
|
|
<div className="bg-surface-75 rounded-lg border font-mono text-sm p-4">
|
|
{parameters.map((param) => (
|
|
<div key={param.key} className="py-0.5 group/param">
|
|
<div className="text-xs flex items-center">
|
|
<span className="text-foreground-lighter">{param.key}:</span>
|
|
<span className="ml-1 text-foreground">{param.value}</span>
|
|
<button
|
|
onClick={() => {
|
|
copyToClipboard(param.value, () => {
|
|
setCopiedMap((prev) => ({ ...prev, [param.key]: true }))
|
|
onCopy?.(param.key)
|
|
setTimeout(() => {
|
|
setCopiedMap((prev) => ({ ...prev, [param.key]: false }))
|
|
}, 1000)
|
|
})
|
|
}}
|
|
className={cn(
|
|
'text-foreground-lighter',
|
|
'ml-2 opacity-0 group-hover/param:opacity-100',
|
|
'hover:text-foreground rounded-xs p-1',
|
|
copiedMap[param.key] && 'opacity-100',
|
|
'transition-all'
|
|
)}
|
|
>
|
|
{copiedMap[param.key] ? (
|
|
<Check size={12} strokeWidth={1.5} />
|
|
) : (
|
|
<Copy size={12} strokeWidth={1.5} />
|
|
)}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
))}
|
|
</div>
|
|
)
|
|
}
|