diff --git a/src/components/custom-ui/labeled-input.tsx b/src/components/custom-ui/labeled-input.tsx
index 5505e14..6db0691 100644
--- a/src/components/custom-ui/labeled-input.tsx
+++ b/src/components/custom-ui/labeled-input.tsx
@@ -17,6 +17,7 @@ export default function LabeledInput({
variantSize = 'default',
autocomplete,
error,
+ 'data-cy': dataCy,
...rest
}: {
label: string;
@@ -30,6 +31,7 @@ export default function LabeledInput({
variantSize?: 'default' | 'big' | 'textarea';
autocomplete?: string;
error?: string;
+ 'data-cy'?: string;
} & React.InputHTMLAttributes
) {
const [passwordVisible, setPasswordVisible] = React.useState(false);
const [inputValue, setInputValue] = React.useState(
@@ -58,6 +60,7 @@ export default function LabeledInput({
id={name}
name={name}
rows={3}
+ data-cy={dataCy}
/>
) : (
@@ -76,6 +79,7 @@ export default function LabeledInput({
id={name}
name={name}
autoComplete={autocomplete}
+ data-cy={dataCy}
{...rest}
onChange={handleInputChange}
/>
diff --git a/src/components/forms/event-form.tsx b/src/components/forms/event-form.tsx
index 11bf820..26824df 100644
--- a/src/components/forms/event-form.tsx
+++ b/src/components/forms/event-form.tsx
@@ -191,11 +191,6 @@ const EventForm: React.FC = (props) => {
router.back();
}
- // Calculate values for organiser, created, and updated
- const organiserValue = isLoading
- ? 'Loading...'
- : data?.data.user?.name || 'Unknown User';
-
// Use DB values for created_at/updated_at in edit mode
const createdAtValue =
props.type === 'edit' && event?.created_at
@@ -210,188 +205,203 @@ const EventForm: React.FC = (props) => {
const createdAtDisplay = new Date(createdAtValue).toLocaleDateString();
const updatedAtDisplay = new Date(updatedAtValue).toLocaleDateString();
+ const [isClient, setIsClient] = React.useState(false);
+ React.useEffect(() => {
+ setIsClient(true);
+ }, []);
+
if (props.type === 'edit' && isLoading) return Loading...
;
if (props.type === 'edit' && fetchError)
return Error loading event.
;
return (
- <>
-