Skip to content

Commit 100407f

Browse files
committed
chore: Simplify IOCell
1 parent e8a5bac commit 100407f

13 files changed

Lines changed: 127 additions & 1006 deletions

File tree

react-compiler.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ export const REACT_COMPILER_ENABLED_DIRS = [
5959
"src/components/shared/Dialogs/MultilineTextInputDialog.tsx",
6060
"src/components/shared/HighlightText.tsx",
6161
"src/components/shared/AnnouncementBanners.tsx",
62+
"src/components/shared/ReactFlow/FlowCanvas/TaskNode/TaskOverview/IOSection",
6263

6364
// 11-20 useCallback/useMemo
6465
// "src/components/ui", // 12

src/components/shared/CopyText/CopyText.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { copyToClipboard } from "@/utils/string";
99

1010
interface CopyTextProps {
1111
children: string;
12+
displayValue?: string;
1213
className?: string;
1314
alwaysShowButton?: boolean;
1415
compact?: boolean;
@@ -17,6 +18,7 @@ interface CopyTextProps {
1718

1819
export const CopyText = ({
1920
children,
21+
displayValue,
2022
className,
2123
alwaysShowButton = false,
2224
compact = false,
@@ -61,7 +63,7 @@ export const CopyText = ({
6163
isCopied && "text-emerald-400!",
6264
)}
6365
>
64-
{children}
66+
{displayValue ?? children}
6567
</Text>
6668

6769
<Button
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { CopyText } from "@/components/shared/CopyText/CopyText";
2+
import { Icon } from "@/components/ui/icon";
3+
import { InlineStack } from "@/components/ui/layout";
4+
import { Link } from "@/components/ui/link";
5+
import { convertArtifactUriToHTTPUrl } from "@/utils/URL";
6+
7+
interface ArtifactURIProps {
8+
uri: string;
9+
isDir: boolean;
10+
}
11+
12+
const ArtifactURI = ({ uri, isDir }: ArtifactURIProps) => {
13+
return (
14+
<InlineStack gap="1" wrap="nowrap" blockAlign="center">
15+
<Link href={convertArtifactUriToHTTPUrl(uri, isDir)} external size="xs">
16+
Link
17+
</Link>
18+
19+
<Icon name="Dot" size="md" className="text-muted-foreground" />
20+
21+
<CopyText
22+
size="xs"
23+
compact
24+
displayValue="Copy URI"
25+
className="text-sky-500 hover:text-sky-600"
26+
>
27+
{uri}
28+
</CopyText>
29+
</InlineStack>
30+
);
31+
};
32+
33+
export default ArtifactURI;

src/components/shared/ReactFlow/FlowCanvas/TaskNode/TaskOverview/IOSection/IOCell/IOCell.test.tsx

Lines changed: 0 additions & 170 deletions
This file was deleted.

0 commit comments

Comments
 (0)