@giteeteam/apps-team-components 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
export interface
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface WorkspaceReadViewProps {
|
|
3
3
|
value?: {
|
|
4
4
|
name?: string;
|
|
5
|
+
key?: string;
|
|
5
6
|
};
|
|
6
7
|
}
|
|
7
|
-
declare const WorkspaceReadView:
|
|
8
|
+
declare const WorkspaceReadView: import("react").NamedExoticComponent<WorkspaceReadViewProps>;
|
|
8
9
|
export default WorkspaceReadView;
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import { memo } from 'react';
|
|
3
|
+
import { ClassNames } from '@emotion/react';
|
|
3
4
|
import EmptyField from '../../common/EmptyField';
|
|
4
|
-
import
|
|
5
|
+
import { getTooltipMaxlineStyle, tooltipOverflowStyle } from '../../common/overflow-tooltip/style';
|
|
6
|
+
import { useToWorkspacePage } from '../bind-workspace/hooks';
|
|
7
|
+
import { pointerStyle } from '../bind-workspace/style';
|
|
5
8
|
const WorkspaceReadView = memo(({ value }) => {
|
|
6
|
-
|
|
9
|
+
const { name, key } = value || {};
|
|
10
|
+
const { toWorkspacePage } = useToWorkspacePage();
|
|
11
|
+
return (_jsx(ClassNames, { children: ({ cx, css }) => {
|
|
12
|
+
return name ? (_jsx("span", { className: cx(css(tooltipOverflowStyle), css(getTooltipMaxlineStyle(1)), css(pointerStyle)), title: name, onClick: () => toWorkspacePage(key), children: name })) : (_jsx(EmptyField, { readonly: true }));
|
|
13
|
+
} }));
|
|
7
14
|
});
|
|
8
15
|
WorkspaceReadView.displayName = 'WorkspaceReadView';
|
|
9
16
|
export default WorkspaceReadView;
|