@infinilabs/doc-detail 0.0.6 → 0.0.7

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.
package/dist/index.d.ts CHANGED
@@ -53,9 +53,6 @@ declare interface DocDetailProps extends HTMLAttributes<HTMLDivElement> {
53
53
  };
54
54
  };
55
55
  i18n?: {
56
- buttons?: {
57
- openSource?: string;
58
- };
59
56
  labels?: {
60
57
  type?: string;
61
58
  size?: string;
@@ -66,8 +63,7 @@ declare interface DocDetailProps extends HTMLAttributes<HTMLDivElement> {
66
63
  aiInterpretation?: string;
67
64
  };
68
65
  };
69
- extraButtons?: ReactNode[];
70
- openSourceButtonProps?: ActionButtonProps;
66
+ actionButtons?: ReactNode[];
71
67
  }
72
68
 
73
69
  declare type MetadataContentType = "image" | "video" | "markdown" | "pdf" | "docx" | "pptx" | "xlsx";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@infinilabs/doc-detail",
3
3
  "private": false,
4
- "version": "0.0.6",
4
+ "version": "0.0.7",
5
5
  "type": "module",
6
6
  "main": "dist/doc-detail.cjs",
7
7
  "module": "dist/doc-detail.js",
package/src/App.tsx CHANGED
@@ -1,4 +1,4 @@
1
- import { Bot } from "lucide-react";
1
+ import { Bot, SquareArrowOutUpRight } from "lucide-react";
2
2
  import { ActionButton, DocDetail } from "./components";
3
3
 
4
4
  const App = () => {
@@ -90,9 +90,11 @@ mindmap
90
90
  created: "2026-01-09T02:30:10.188Z",
91
91
  updated: "2026-01-09T02:30:10.188Z",
92
92
  }}
93
- extraButtons={[
94
- <ActionButton key="bot" icon={<Bot />}>
95
- Continue Chat
93
+ actionButtons={[
94
+ <ActionButton icon={<Bot />}>Continue Chat</ActionButton>,
95
+
96
+ <ActionButton icon={<SquareArrowOutUpRight />}>
97
+ Open Source
96
98
  </ActionButton>,
97
99
  ]}
98
100
  />
@@ -1,18 +1,17 @@
1
1
  import { Typography } from "antd";
2
- import {
3
- ChevronRight,
4
- Dot,
5
- Ellipsis,
6
- Minus,
7
- SquareArrowOutUpRight,
8
- } from "lucide-react";
2
+ import { ChevronRight, Dot, Ellipsis, Minus } from "lucide-react";
9
3
  import { motion } from "motion/react";
10
4
 
11
- import { useState, type FC, type HTMLAttributes, type ReactNode } from "react";
5
+ import {
6
+ Fragment,
7
+ useState,
8
+ type FC,
9
+ type HTMLAttributes,
10
+ type ReactNode,
11
+ } from "react";
12
12
  import Preview from "./components/Preview";
13
13
  import AIInterpretation from "./components/AIInterpretation";
14
14
  import { cn } from "@/utils/cn";
15
- import ActionButton, { type ActionButtonProps } from "../ActionButton";
16
15
 
17
16
  const { Text } = Typography;
18
17
 
@@ -69,9 +68,6 @@ export interface DocDetailProps extends HTMLAttributes<HTMLDivElement> {
69
68
  };
70
69
  };
71
70
  i18n?: {
72
- buttons?: {
73
- openSource?: string;
74
- };
75
71
  labels?: {
76
72
  type?: string;
77
73
  size?: string;
@@ -82,19 +78,11 @@ export interface DocDetailProps extends HTMLAttributes<HTMLDivElement> {
82
78
  aiInterpretation?: string;
83
79
  };
84
80
  };
85
- extraButtons?: ReactNode[];
86
- openSourceButtonProps?: ActionButtonProps;
81
+ actionButtons?: ReactNode[];
87
82
  }
88
83
 
89
84
  const DocDetail: FC<DocDetailProps> = (props) => {
90
- const {
91
- data,
92
- i18n,
93
- extraButtons,
94
- className,
95
- openSourceButtonProps,
96
- ...rest
97
- } = props;
85
+ const { data, i18n, actionButtons, className, ...rest } = props;
98
86
 
99
87
  const [visibleMore, setVisibleMore] = useState(false);
100
88
 
@@ -154,17 +142,9 @@ const DocDetail: FC<DocDetailProps> = (props) => {
154
142
  </Text>
155
143
 
156
144
  <div className="inline-flex gap-2">
157
- {extraButtons}
158
-
159
- <ActionButton
160
- icon={<SquareArrowOutUpRight />}
161
- onClick={() => {
162
- window.open(data.url);
163
- }}
164
- {...openSourceButtonProps}
165
- >
166
- {i18n?.buttons?.openSource ?? "Open Source"}
167
- </ActionButton>
145
+ {actionButtons?.map((button, index) => (
146
+ <Fragment key={index}>{button}</Fragment>
147
+ ))}
168
148
  </div>
169
149
  </div>
170
150