import React from 'react'; import { NoteAction, NoteContent, NoteLabel, StyledNote, StyledNoteLeft } from './Note.style'; import { CheckCircle, Info, Warning, WarningOctagon } from '@phosphor-icons/react'; export interface NoteProps extends React.ComponentPropsWithRef<'div'> { action?: React.ReactNode; variant?: 'info' | 'success' | 'good' | 'warning' | 'error'; fill?: boolean; label?: React.ReactNode; } const defaultLabel: Record<'info' | 'success' | 'good' | 'warning' | 'error', React.ReactNode> = { info: , good: , success: , warning: , error: , }; export const Note = React.forwardRef((props, ref) => { const { children, variant = 'info', fill = false, label, ...otherProps } = props; const styleProps = { $variant: props.variant, $fill: fill, }; const labelComponent = label || defaultLabel[variant]; return ( {labelComponent} {children} {props.action && {props.action}} ); });