Skip to content

Commit 3386c25

Browse files
committed
docs: added doc support for file-addition-trigger
1 parent 1cfc533 commit 3386c25

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
title: File Additions Trigger
3+
description: File Additions Trigger component documentation
4+
---
5+
6+
The File Additions Trigger component provides a UI element for creating new files or uploading files. It uses a dropdown menu to offer these options.
7+
8+
import { DocsPage } from "@/components/docs-page";
9+
10+
<DocsPage.ComponentExample
11+
client:only
12+
code={`<FileAdditionsTrigger
13+
useTranslationStore={() => ({ t: (key, fallback) => fallback })}
14+
pathNewFile="/new-file"
15+
pathUploadFiles="/upload-files"
16+
/>`}
17+
/>
18+
19+
## Usage
20+
21+
```typescript jsx
22+
import { FileAdditionsTrigger } from '@harnessio/ui/components'
23+
24+
return (
25+
<FileAdditionsTrigger
26+
useTranslationStore={useTranslationStoreHook} // [REQUIRED] Translation hook for i18n support
27+
pathNewFile="/new-file" // [REQUIRED] Navigation path for new file creation
28+
pathUploadFiles="/upload-files" // [REQUIRED] Navigation path for file upload
29+
className="my-class" // [OPTIONAL] Additional CSS classes
30+
/>
31+
)
32+
```
33+
34+
## API Reference
35+
36+
<DocsPage.PropsTable
37+
props={[
38+
{
39+
name: "useTranslationStore",
40+
description:
41+
"Function that returns a translation store object with a 't' function for internationalization support. The 't' function takes a key and fallback text.",
42+
required: true,
43+
value: "() => { t: (key: string, fallback: string) => string }",
44+
},
45+
{
46+
name: "pathNewFile",
47+
description:
48+
"URL path to navigate to when the user selects the 'Create New File' option from the dropdown",
49+
required: true,
50+
value: "string",
51+
},
52+
{
53+
name: "pathUploadFiles",
54+
description:
55+
"URL path to navigate to when the user selects the 'Upload Files' option from the dropdown",
56+
required: true,
57+
value: "string",
58+
},
59+
{
60+
name: "className",
61+
description: "Additional CSS classes to apply to the component",
62+
required: false,
63+
value: "string",
64+
},
65+
]}
66+
/>

0 commit comments

Comments
 (0)