chore: better Prettier config for easier reviews

This commit is contained in:
2023-10-23 23:33:39 +02:00
parent a8781724d4
commit 71ea41695f
209 changed files with 4093 additions and 4114 deletions

View File

@ -1,10 +1,10 @@
import classNames from 'clsx'
import useTranslation from 'next-translate/useTranslation'
import type { FetchState as FormStateType } from 'react-component-form'
import classNames from "clsx"
import useTranslation from "next-translate/useTranslation"
import type { FetchState as FormStateType } from "react-component-form"
import { Loader } from '../Loader'
import { Loader } from "../Loader"
export interface FormStateProps extends React.ComponentPropsWithoutRef<'div'> {
export interface FormStateProps extends React.ComponentPropsWithoutRef<"div"> {
state: FormStateType
message?: string | null
id?: string
@ -14,15 +14,15 @@ export const FormState: React.FC<FormStateProps> = (props) => {
const { state, message, id, ...rest } = props
const { t } = useTranslation()
if (state === 'loading') {
if (state === "loading") {
return (
<div data-cy='loader' className='mt-8 flex justify-center'>
<div data-cy="loader" className="mt-8 flex justify-center">
<Loader />
</div>
)
}
if (state === 'idle' || message == null) {
if (state === "idle" || message == null) {
return null
}
@ -31,15 +31,15 @@ export const FormState: React.FC<FormStateProps> = (props) => {
{...rest}
className={classNames(
props.className,
'mt-6 flex max-w-xl items-center text-center font-medium',
"mt-6 flex max-w-xl items-center text-center font-medium",
{
'text-red-800 dark:text-red-400': state === 'error',
'text-green-800 dark:text-green-400': state === 'success'
}
"text-red-800 dark:text-red-400": state === "error",
"text-green-800 dark:text-green-400": state === "success",
},
)}
>
<div className='inline bg-cover font-headline' />
<span id={id} className='pl-2'>
<div className="inline bg-cover font-headline" />
<span id={id} className="pl-2">
<b>{t(`errors:${state}`)}:</b> {message}
</span>
</div>

View File

@ -1 +1 @@
export * from './FormState'
export * from "./FormState"