Skip to content

Commit

Permalink
call external file for videos showcase
Browse files Browse the repository at this point in the history
  • Loading branch information
tgrall committed Oct 23, 2024
1 parent b1371da commit 3cbe776
Show file tree
Hide file tree
Showing 3 changed files with 447 additions and 563 deletions.
16 changes: 15 additions & 1 deletion src/components/CopilotShowcase.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
import React, { useState } from 'react';
import clsx from 'clsx';
import styles from './CopilotShowcase.module.css';
import videos from './videos.json';
import { useEffect } from 'react';



export default function CopilotShowcase() {

const [videos, setVideos] = useState([]);
const [filteredVideos, setFilteredVideos] = useState(videos);
const [selectedTag, setSelectedTag] = useState(null);

useEffect(() => {
fetch('https://raw.githubusercontent.com/tgrall/automation/refs/heads/main/data/blog/videos.json')
.then(response => response.json())
.then(data => {
setVideos(data);
setFilteredVideos(data);

})
.catch(error => console.error('Error fetching videos:', error));
}, []);

const handleTagClick = (tag) => {
if (selectedTag === tag) {
setFilteredVideos(videos);
Expand Down
304 changes: 0 additions & 304 deletions src/components/videos.json

This file was deleted.

Loading

0 comments on commit 3cbe776

Please sign in to comment.