File size: 715 Bytes
503a577
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import React from 'react'
import type { ExamplesData } from './Examples'

interface GalleryProps {
  selectedModel: string
  selectedAttack: string
  examples: {
    [model: string]: {
      [attack: string]: ExamplesData[]
    }
  }
}

const VideoGallery: React.FC<GalleryProps> = ({ selectedModel, selectedAttack, examples }) => {
  const exampleItems = examples[selectedModel][selectedAttack]
  return (
    <div className="example-display">
      {exampleItems.map((item, index) => (
        <div key={index} className="example-item">
          <p>{item.name}</p>
          <video controls src={item.video_url} className="example-video" />
        </div>
      ))}
    </div>
  )
}

export default VideoGallery