mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-10 07:25:35 +00:00
Remove: <a> tags
This commit is contained in:
@@ -1,57 +1,63 @@
|
||||
import Head from 'next/head';
|
||||
import Link from 'next/link';
|
||||
import Head from "next/head";
|
||||
import Link from "next/link";
|
||||
|
||||
import MessageManager from './MessageManager';
|
||||
import MessageManager from "./MessageManager";
|
||||
|
||||
import styles from '../styles/create.module.scss';
|
||||
import styles from "../styles/create.module.scss";
|
||||
|
||||
import { config } from '../config';
|
||||
import { config } from "../config";
|
||||
|
||||
interface FormProps {
|
||||
title: string;
|
||||
errorMessage?: string;
|
||||
successMessage?: string;
|
||||
infoMessage?: string;
|
||||
title: string;
|
||||
errorMessage?: string;
|
||||
successMessage?: string;
|
||||
infoMessage?: string;
|
||||
|
||||
canSubmit: boolean;
|
||||
handleSubmit: (event) => void;
|
||||
canSubmit: boolean;
|
||||
handleSubmit: (event) => void;
|
||||
|
||||
textBtnConfirm?: string;
|
||||
classBtnConfirm?: string;
|
||||
textBtnConfirm?: string;
|
||||
classBtnConfirm?: string;
|
||||
|
||||
children: any;
|
||||
children: any;
|
||||
}
|
||||
export default function Form({
|
||||
title,
|
||||
errorMessage,
|
||||
successMessage,
|
||||
infoMessage,
|
||||
canSubmit,
|
||||
handleSubmit,
|
||||
textBtnConfirm = 'Valider',
|
||||
classBtnConfirm = '',
|
||||
children
|
||||
title,
|
||||
errorMessage,
|
||||
successMessage,
|
||||
infoMessage,
|
||||
canSubmit,
|
||||
handleSubmit,
|
||||
textBtnConfirm = "Valider",
|
||||
classBtnConfirm = "",
|
||||
children,
|
||||
}: FormProps) {
|
||||
return (<>
|
||||
<Head>
|
||||
<title>{config.siteName} — {title}</title>
|
||||
</Head>
|
||||
<div className={`App ${styles['create-app']}`}>
|
||||
<h2>{title}</h2>
|
||||
<form onSubmit={handleSubmit}>
|
||||
{children}
|
||||
<button type='submit' className={classBtnConfirm} disabled={!canSubmit}>
|
||||
{textBtnConfirm}
|
||||
</button>
|
||||
</form>
|
||||
<Link href='/'>
|
||||
<a>← Revenir à l'accueil</a>
|
||||
</Link>
|
||||
<MessageManager
|
||||
info={infoMessage}
|
||||
error={errorMessage}
|
||||
success={successMessage}
|
||||
/>
|
||||
</div>
|
||||
</>)
|
||||
}
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>
|
||||
{config.siteName} — {title}
|
||||
</title>
|
||||
</Head>
|
||||
<div className={`App ${styles["create-app"]}`}>
|
||||
<h2>{title}</h2>
|
||||
<form onSubmit={handleSubmit}>
|
||||
{children}
|
||||
<button
|
||||
type="submit"
|
||||
className={classBtnConfirm}
|
||||
disabled={!canSubmit}
|
||||
>
|
||||
{textBtnConfirm}
|
||||
</button>
|
||||
</form>
|
||||
<Link href="/">← Revenir à l'accueil</Link>
|
||||
<MessageManager
|
||||
info={infoMessage}
|
||||
error={errorMessage}
|
||||
success={successMessage}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user