Files
wanderer/assets/js/hooks/Mapper/components/ui-kit/InfoDrawer/InfoDrawer.tsx
Aleksei Chichenkov b2ae5a33ae System comments & refactoring (#253)
* feat(Map): Add widget for comments. Refactor design of Signatures widget. Refactor a lot of code. Add Transition component in ui-kit. Sync versions of react.

---------

Co-authored-by: Dmitry Popov <dmitriypopovsamara@gmail.com>
Co-authored-by: achichenkov <aleksei.chichenkov@telleqt.ai>
2025-03-14 15:34:12 +04:00

32 lines
912 B
TypeScript

import classes from './InfoDrawer.module.scss';
import { WithChildren, WithClassName, WithHTMLProps } from '@/hooks/Mapper/types/common.ts';
import clsx from 'clsx';
import React from 'react';
export type InfoDrawerProps = { title?: React.ReactNode; labelClassName?: string; rightSide?: boolean } & WithChildren &
WithClassName &
Omit<WithHTMLProps, 'title'>;
export const InfoDrawer = ({
title,
children,
className,
labelClassName,
rightSide,
...htmlProps
}: InfoDrawerProps) => {
return (
<div
className={clsx(classes.InfoDrawerRoot, 'text-xs pl-1', className, {
[classes.RightSide]: rightSide,
'flex flex-col items-end pr-1': rightSide,
'pl-1': !rightSide,
})}
{...htmlProps}
>
{title && <div className={clsx(classes.InfoDrawerLabel, 'text-neutral-400', labelClassName)}>{title}</div>}
<div>{children}</div>
</div>
);
};