From d4b63cd5afbf67354d323bd9d6dc9ee17747b237 Mon Sep 17 00:00:00 2001 From: Mikolaj Schatt <45075843+r1skz3ro@users.noreply.github.com> Date: Tue, 16 Jul 2024 10:07:22 +0200 Subject: [PATCH] fix: add use clinet to form provider (#101) --- frontend/src/components/common/Input/Input.tsx | 4 ++-- .../addEmployee/AddEmployeeFormProvider/AddEmployeeForm.tsx | 1 + frontend/src/static/icons/AlertTriangleIcon.tsx | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/common/Input/Input.tsx b/frontend/src/components/common/Input/Input.tsx index d4001e9a..9535fcbc 100644 --- a/frontend/src/components/common/Input/Input.tsx +++ b/frontend/src/components/common/Input/Input.tsx @@ -3,7 +3,7 @@ import { InputProps } from './Input.interface'; import { useFormContext } from 'react-hook-form'; import { generateClassNames } from '@app/utils'; import { ErrorMessage } from '@hookform/error-message'; -import { CheckMarkIcon } from '@app/static/icons/AlertTriangleIcon'; +import { AlertTriangleIcon } from '@app/static/icons/AlertTriangleIcon'; export const Input: FC = memo(({ label, name, placeholder, options = {}, ...otherProps }) => { const { formState, register, getFieldState } = useFormContext(); @@ -31,7 +31,7 @@ export const Input: FC = memo(({ label, name, placeholder, options = name={name} render={({ message }) => (
- +
{message}
)} diff --git a/frontend/src/components/pages/addEmployee/AddEmployeeFormProvider/AddEmployeeForm.tsx b/frontend/src/components/pages/addEmployee/AddEmployeeFormProvider/AddEmployeeForm.tsx index 8e654493..ce9afb14 100644 --- a/frontend/src/components/pages/addEmployee/AddEmployeeFormProvider/AddEmployeeForm.tsx +++ b/frontend/src/components/pages/addEmployee/AddEmployeeFormProvider/AddEmployeeForm.tsx @@ -1,3 +1,4 @@ +'use client'; import { FC, PropsWithChildren } from 'react'; import { useForm } from 'react-hook-form'; diff --git a/frontend/src/static/icons/AlertTriangleIcon.tsx b/frontend/src/static/icons/AlertTriangleIcon.tsx index 6075b26c..10bae4fc 100644 --- a/frontend/src/static/icons/AlertTriangleIcon.tsx +++ b/frontend/src/static/icons/AlertTriangleIcon.tsx @@ -1,4 +1,4 @@ -export const CheckMarkIcon: React.FC> = (props) => ( +export const AlertTriangleIcon: React.FC> = (props) => (