mirror of
https://github.com/lux-tel/websites.git
synced 2026-10-30 20:31:36 +00:00
28 lines
762 B
TypeScript
28 lines
762 B
TypeScript
import { cn } from '@session/ui/lib/utils';
|
|
import { type HTMLAttributes, forwardRef } from 'react';
|
|
|
|
export type NodeNotificationProps = HTMLAttributes<HTMLSpanElement> & {
|
|
level?: 'info' | 'warning' | 'error';
|
|
};
|
|
|
|
export const NodeNotification = forwardRef<HTMLSpanElement, NodeNotificationProps>(
|
|
({ className, children, level, ...props }, ref) => (
|
|
<span
|
|
ref={ref}
|
|
className={cn(
|
|
'flex w-3/4 flex-row gap-1 font-normal text-xs sm:w-max md:text-base',
|
|
level === 'warning'
|
|
? 'text-warning'
|
|
: level === 'error'
|
|
? 'text-destructive'
|
|
: 'text-session-text',
|
|
className
|
|
)}
|
|
{...props}
|
|
>
|
|
<span className="mr-1">•</span>
|
|
{children}
|
|
</span>
|
|
)
|
|
);
|