mirror of
https://github.com/documenso/documenso.git
synced 2025-11-10 04:22:32 +10:00
Allows changing the owner of an organisation within the admin panel, useful for support requests to change ownership from a testing account to the main admin account. <img width="890" height="431" alt="image" src="https://github.com/user-attachments/assets/475bbbdd-0f26-4f74-aacf-3e793366551d" />
48 lines
1.6 KiB
TypeScript
48 lines
1.6 KiB
TypeScript
import * as React from 'react';
|
|
|
|
import type { VariantProps } from 'class-variance-authority';
|
|
import { cva } from 'class-variance-authority';
|
|
|
|
import { cn } from '../lib/utils';
|
|
|
|
const badgeVariants = cva(
|
|
'inline-flex items-center rounded-md text-xs font-medium ring-1 ring-inset w-fit',
|
|
{
|
|
variants: {
|
|
variant: {
|
|
neutral:
|
|
'bg-gray-50 text-gray-600 ring-gray-500/10 dark:bg-gray-400/10 dark:text-gray-400 dark:ring-gray-400/20',
|
|
destructive:
|
|
'bg-red-50 text-red-700 ring-red-600/10 dark:bg-red-400/10 dark:text-red-400 dark:ring-red-400/20',
|
|
warning:
|
|
'bg-yellow-50 text-yellow-800 ring-yellow-600/20 dark:bg-yellow-400/10 dark:text-yellow-500 dark:ring-yellow-400/20',
|
|
default:
|
|
'bg-green-50 text-green-700 ring-green-600/20 dark:bg-green-500/10 dark:text-green-400 dark:ring-green-500/20',
|
|
secondary:
|
|
'bg-blue-50 text-blue-700 ring-blue-700/10 dark:bg-blue-400/10 dark:text-blue-400 dark:ring-blue-400/30',
|
|
},
|
|
size: {
|
|
small: 'px-1.5 py-0.5 text-xs',
|
|
default: 'px-2 py-1.5 text-xs',
|
|
large: 'px-3 py-2 text-sm',
|
|
},
|
|
},
|
|
defaultVariants: {
|
|
variant: 'default',
|
|
size: 'default',
|
|
},
|
|
},
|
|
);
|
|
|
|
export interface BadgeProps
|
|
extends React.HTMLAttributes<HTMLDivElement>,
|
|
VariantProps<typeof badgeVariants> {}
|
|
|
|
function Badge({ className, variant, size, ...props }: BadgeProps) {
|
|
return (
|
|
<div role="status" className={cn(badgeVariants({ variant, size }), className)} {...props} />
|
|
);
|
|
}
|
|
|
|
export { Badge, badgeVariants };
|