import { Dispatch, Fragment, SetStateAction, useRef, useState } from 'react'
import { useTranslation } from 'next-i18next'
import { Dialog, Transition } from '@headlessui/react'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { useClipboard } from 'use-clipboard-copy'
import { getBaseUrl } from '../utils/getBaseUrl'
import { getStoredToken } from '../utils/protectedRouteHandler'
import { getReadablePath } from '../utils/getReadablePath'
function LinkContainer({ title, value }: { title: string; value: string }) {
const clipboard = useClipboard({ copiedTimeout: 1000 })
return (
<>
{title}
{value}
>
)
}
export default function CustomEmbedLinkMenu({
path,
menuOpen,
setMenuOpen,
}: {
path: string
menuOpen: boolean
setMenuOpen: Dispatch>
}) {
const { t } = useTranslation()
const hashedToken = getStoredToken(path)
// Focus on input automatically when menu modal opens
const focusInputRef = useRef(null)
const closeMenu = () => setMenuOpen(false)
const readablePath = getReadablePath(path)
const filename = readablePath.substring(readablePath.lastIndexOf('/') + 1)
const [name, setName] = useState(filename)
return (
)
}