import { useState } from 'react'
import Cookies from 'universal-cookie'
import SwipeableViews from 'react-swipeable-views'
import HeadTag from '../../components/HeadTag'
import AddEditFunction from '../../components/FunctionAdmin/AddEditFunction'
import EditArticleFunction from '../../components/FunctionAdmin/EditArticleFunction'
import EditFormFunction from '../../components/FunctionAdmin/EditFormFunction'
import redirect from '../../utils/redirect'
import api, { API_URL } from '../../utils/api'
import '../../components/FunctionPage/FunctionTabs.css'
import '../../public/css/pages/admin.css'
const AdminFunctionComponent = props => {
const [slideIndex, setSlideIndex] = useState(0)
const handleDeleteFunction = async () => {
await api.delete(`/admin/functions/${props.functionInfo.id}`, {
headers: { Authorization: props.user.token }
})
redirect({}, '/admin')
}
return (
<>