From 88f51ef5f541e09c5b832a1098a5ea1db3545346 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20FAMIBELLE-PRONZOLA?= Date: Mon, 20 May 2024 14:45:43 +0400 Subject: [PATCH] Create Edit component --- components/konstitisyon/edit.js | 52 +++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 components/konstitisyon/edit.js diff --git a/components/konstitisyon/edit.js b/components/konstitisyon/edit.js new file mode 100644 index 0000000..7606e0c --- /dev/null +++ b/components/konstitisyon/edit.js @@ -0,0 +1,52 @@ +'use client' + +import PropTypes from 'prop-types' +import {useRouter} from 'next/navigation' +import IconButton from '@mui/material/IconButton' +import {styled} from '@mui/material/styles' +import Tooltip, {tooltipClasses} from '@mui/material/Tooltip' +import ArticleIcon from '@mui/icons-material/Article' +import TitleIcon from '@mui/icons-material/Title' + +const LightTooltip = styled(({className, ...props}) => ( + +))(({theme}) => ({ + [`& .${tooltipClasses.tooltip}`]: { + backgroundColor: theme.palette.common.white, + color: 'rgba(0, 0, 0, 0.87)', + boxShadow: theme.shadows[1], + fontSize: 15, + }, +})) + +export default function Edit({titre, article, session}) { + const router = useRouter() + + const handleClick = () => { + console.log('titre', titre) + console.log('article', article) + if (!session) { + router.push('/login') + } + } + + return ( + + {titre ? ( + + + + ) : ( + + + + )} + + ) +} + +Edit.propTypes = { + titre: PropTypes.string, + article: PropTypes.string, + session: PropTypes.object.isRequired +}