Skip to content

🎥 Make videos programmatically with React

added credits component

evoxf1e01f951d5f32
diff --git a/packages/docs/src/components/Credits.tsx b/packages/docs/src/components/Credits.tsx
new file mode 100644
index 0000000000..b46cf7308c
--- /dev/null
+++ b/packages/docs/src/components/Credits.tsx
@@ -0,0 +1,111 @@
+import React, { useEffect, useState } from "react";
+
+const contributors = [
+ // Add your contributors here
+ {
+ id: 1,
+ username: "evoxf1",
+ avatarUrl: "https://github.com/evoxf1.png",
+ contributionType: "creitsad pasfojafpsn asnfansfoasnf asfn akjsfn ",
+ },
+];
+
+const containerStyle: React.CSSProperties = {
+ margin: "20px 0",
+};
+
+const cardContainerStyle: React.CSSProperties = {
+ display: "flex",
+ flexWrap: "wrap",
+ justifyContent: "flex-start",
+};
+
+const cardStyle: React.CSSProperties = {
+ maxWidth: "300px",
+ width: "100%",
+ border: "1px solid #e1e4e8",
+ borderRadius: "10px",
+ overflow: "hidden",
+ margin: "10px",
+ padding: "20px",
+ display: "flex",
+};
+
+const avatarStyle: React.CSSProperties = {
+ width: "100px",
+ height: "100px",
+ borderRadius: "50%",
+ marginRight: "20px",
+ flexShrink: 0,
+};
+
+const infoStyle: React.CSSProperties = {
+ display: "flex",
+ flexDirection: "column",
+};
+
+const linkStyle: React.CSSProperties = {
+ textDecoration: "none",
+ fontSize: "1.2em",
+ color: "#0366d6",
+};
+
+const labelStyle: React.CSSProperties = {
+ fontSize: "1em",
+ color: "#586069",
+ marginTop: "10px",
+};
+
+const Credits = () => {
+ const [contributorsWithNames, setContributorsWithNames] = useState([]);
+
+ useEffect(() => {
+ const fetchContributorNames = async () => {
+ const contributorsData = await Promise.all(
+ contributors.map(async (contributor) => {
+ const response = await fetch(
+ `https://api.github.com/users/${contributor.username}`,
+ );
+ const userData = await response.json();
+ return {
+ ...contributor,
+ name: userData.name || contributor.username,
+ };
+ }),
+ );
+ setContributorsWithNames(contributorsData);
+ };
+
+ fetchContributorNames();
+ }, []);
+
+ return (
+ <div style={containerStyle}>
+ <h3 style={{ fontSize: "2.5em", marginBottom: "20px" }}>Credits</h3>
+ <div style={cardContainerStyle}>
+ {contributorsWithNames.map((contributor) => (
+ <div key={contributor.id} style={cardStyle}>
+ <img
+ src={contributor.avatarUrl}
+ alt={contributor.username}
+ style={avatarStyle}
+ />
+ <div style={infoStyle}>
+ <a
+ href={`https://github.com/${contributor.username}`}
+ target="_blank"
+ rel="noopener noreferrer"
+ style={linkStyle}
+ >
+ <strong>{contributor.name}</strong>
+ </a>
+ <p style={labelStyle}>{contributor.contributionType}</p>
+ </div>
+ </div>
+ ))}
+ </div>
+ </div>
+ );
+};
+
+export default Credits;
diff --git a/packages/docs/src/theme/MDXComponents.js b/packages/docs/src/theme/MDXComponents.js
index 7c91db111c..d930f4525c 100644
--- a/packages/docs/src/theme/MDXComponents.js
+++ b/packages/docs/src/theme/MDXComponents.js
@@ -5,6 +5,7 @@ import { ExperimentalBadge } from "../../components/Experimental";
import { InlineStep, Step } from "../../components/InlineStep";
import { AvailableFrom } from "../components/AvailableFrom";
import { Options } from "../components/Options";
+import { Credits } from '../components/Credits'
export default {
...MDXComponents,
@@ -14,4 +15,5 @@ export default {
Demo,
AvailableFrom,
Options,
+ Credits
};