jbilcke-hf HF staff commited on
Commit
3a944ef
1 Parent(s): a40111f

add button to see the prompt

Browse files
src/app/interface/action-button/index.tsx ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { ReactNode } from "react"
2
+
3
+ import { cn } from "@/lib/utils"
4
+ import Link from "next/link"
5
+
6
+ export function ActionButton({
7
+ className,
8
+ children,
9
+ href
10
+ }: {
11
+ className?: string
12
+ children?: ReactNode
13
+ href?: string
14
+ }) {
15
+
16
+ const classNames = cn(
17
+ `flex flex-row space-x-2 pl-3 pr-4 h-9`,
18
+ `items-center justify-center text-center`,
19
+ `rounded-2xl`,
20
+ `cursor-pointer`,
21
+ `text-sm font-medium`,
22
+ `bg-neutral-700/50 hover:bg-neutral-700/90 text-zinc-100`,
23
+ className,
24
+ )
25
+
26
+ if (href) {
27
+ return (
28
+ <a href={href} className={classNames} target="_blank">
29
+ {children}
30
+ </a>
31
+ )
32
+ }
33
+ return (
34
+ <div className={classNames}>
35
+ {children}
36
+ </div>
37
+ )
38
+ }
src/app/views/public-video-view/index.tsx CHANGED
@@ -5,11 +5,13 @@ import { RiCheckboxCircleFill } from "react-icons/ri"
5
  import { PiShareFatLight } from "react-icons/pi"
6
  import CopyToClipboard from "react-copy-to-clipboard"
7
  import { LuCopyCheck } from "react-icons/lu"
 
8
 
9
  import { useStore } from "@/app/state/useStore"
10
  import { cn } from "@/lib/utils"
11
  import { VideoPlayer } from "@/app/interface/video-player"
12
  import { VideoInfo } from "@/types"
 
13
 
14
 
15
  export function PublicVideoView() {
@@ -133,21 +135,37 @@ export function PublicVideoView() {
133
  `items-center justify-center text-center`,
134
  `rounded-2xl`,
135
  `cursor-pointer`,
 
136
  `bg-neutral-700/50 hover:bg-neutral-700/90 text-zinc-100`
137
  )}>
138
- <div className="flex items-center justify-center pt-0.5">
139
  {
140
  copied ? <LuCopyCheck className="w-4 h-4" />
141
  : <PiShareFatLight className="w-5 h-5" />
142
  }
143
  </div>
144
- <div className="text-sm font-medium">
145
  {
146
  copied ? "Link copied!" : "Share video"
147
  }</div>
148
  </div>
149
  </CopyToClipboard>
150
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
  </div>
152
 
153
  </div>
 
5
  import { PiShareFatLight } from "react-icons/pi"
6
  import CopyToClipboard from "react-copy-to-clipboard"
7
  import { LuCopyCheck } from "react-icons/lu"
8
+ import { LuScrollText } from "react-icons/lu"
9
 
10
  import { useStore } from "@/app/state/useStore"
11
  import { cn } from "@/lib/utils"
12
  import { VideoPlayer } from "@/app/interface/video-player"
13
  import { VideoInfo } from "@/types"
14
+ import { ActionButton } from "@/app/interface/action-button"
15
 
16
 
17
  export function PublicVideoView() {
 
135
  `items-center justify-center text-center`,
136
  `rounded-2xl`,
137
  `cursor-pointer`,
138
+ `text-sm font-medium`,
139
  `bg-neutral-700/50 hover:bg-neutral-700/90 text-zinc-100`
140
  )}>
141
+ <div className="flex items-center justify-center">
142
  {
143
  copied ? <LuCopyCheck className="w-4 h-4" />
144
  : <PiShareFatLight className="w-5 h-5" />
145
  }
146
  </div>
147
+ <div>
148
  {
149
  copied ? "Link copied!" : "Share video"
150
  }</div>
151
  </div>
152
  </CopyToClipboard>
153
  </div>
154
+
155
+ <ActionButton
156
+ href={
157
+ `https://huggingface.co/datasets/${
158
+ video.channel.datasetUser
159
+ }/${
160
+ video.channel.datasetName
161
+ }/raw/main/prompt_${
162
+ video.id
163
+ }.md`
164
+ }
165
+ >
166
+ <LuScrollText />
167
+ <span>See prompt</span>
168
+ </ActionButton>
169
  </div>
170
 
171
  </div>