import { ArrowDownTrayIcon, ClipboardIcon } from "@heroicons/react/24/outline"; import axios from "axios"; import { useEffect, useState } from "react"; import { useParams } from "react-router-dom"; import { toast } from "react-toastify"; import { Tp } from "../type/TpType"; function Practical() { const { id } = useParams(); const [tp, setTp] = useState(); const copyText = (copy: string) => { navigator.clipboard.writeText(copy); toast.success("Copied!", { draggable: true, theme: localStorage.getItem("theme") || "dark", }); }; useEffect(() => { axios.get(`/api/tps/${id}`).then((res) => { setTp(res.data); }); }, [id]); return ( <> {tp && ( <>

{tp.name}

Information

  • {tp.description}
  • Duration: 2 hours
  • Tools Used: Python, SSH, Vim
  • Difficulty: Beginner
  • Date: Oct 23, 2024

Resources

  • SSH:
    copyText(tp.ssh)} > {tp.ssh}
  • Port:
    copyText(tp.port)} > {tp.port}
  • Password:
    copyText(tp.pwd)} > {tp.pwd}
Subject

Download

)} ); } export default Practical;