Files
wanderer/assets/js/hooks/Mapper/components/mapInterface/components/Widget/Widget.tsx
Aleksei Chichenkov d8222d83f0 Refactoring and fixing problems (#317)
* fix(Map): fix design of kills widget, fix design of signatures widget - refactor a lot of code, fixed problem with tooltip blinking

* fix(Map): refactor Tracking dialog, refactor Activity tracker, refactor codebase and some styles

* fix(Core): don't count character passage on manual add connection

* refactor(Core): improved characters tracking API

* fix(Core): fixed link signature to system on 'leads to' set

* fix(Map): Refactor map settings and prepared it to easier using

* fix(Map): Add support new command for following update

* fix(Map): Add support new command for main update

* refactor(Core): Reduce map init data by using cached system static data

* refactor(Core): Reduce map init data by extract signatures loading to a separate event

* fix(Core): adjusted IP rate limits

* fix(Map): Update design of tracking characters. Added icons for following and main. Added ability to see that character on the station or structure

---------

Co-authored-by: achichenkov <aleksei.chichenkov@telleqt.ai>
Co-authored-by: Dmitry Popov <dmitriypopovsamara@gmail.com>
2025-04-11 23:17:53 +04:00

50 lines
1.3 KiB
TypeScript

import React from 'react';
import classes from './Widget.module.scss';
import clsx from 'clsx';
import { WithChildren } from '@/hooks/Mapper/types/common.ts';
export type WidgetProps = {
label: React.ReactNode | string;
windowId?: string;
contentClassName?: string;
} & WithChildren;
export const Widget = ({ label, children, windowId, contentClassName }: WidgetProps) => {
return (
<div
data-window-id={windowId}
className={clsx(
classes.root,
'flex flex-col w-full h-full rounded',
'text-gray-200 shadow-lg',
'border border-gray-500 border-opacity-30',
'bg-opacity-80 bg-neutral-900 ',
)}
>
<div
className={clsx(
classes.Header,
'react-grid-dragHandleExample h-7 text-sm flex w-full',
'bg-gray-400 bg-opacity-5 ',
'px-2 py-1',
'border-b border-gray-500 border-opacity-30',
'cursor-move select-none ',
)}
>
{label}
</div>
<div
className={clsx(classes.Content, 'overflow-auto', 'bg-opacity-5 custom-scrollbar', contentClassName)}
style={{ flexGrow: 1 }}
onContextMenu={e => {
e.preventDefault();
e.stopPropagation();
}}
>
{children}
</div>
</div>
);
};