+
+
{title}
{subtitle &&
@@ -63,9 +55,9 @@ export function LinkedItemsHeaderView({ item, unlinkCallback, itemNameField, ite
diff --git a/src/Components/Profile/Subcomponents/PlusButton.tsx b/src/Components/Profile/Subcomponents/PlusButton.tsx
index 99e75c5d..82a41baf 100644
--- a/src/Components/Profile/Subcomponents/PlusButton.tsx
+++ b/src/Components/Profile/Subcomponents/PlusButton.tsx
@@ -1,19 +1,19 @@
-import { LayerProps } from "../../../types";
-import { useHasUserPermission } from "../../Map/hooks/usePermissions";
+import { LayerProps } from '../../../types'
+import { useHasUserPermission } from '../../Map/hooks/usePermissions'
-export function PlusButton({ layer, triggerAction, color, collection="items" }: { layer?: LayerProps ,triggerAction: any, color: string, collection?:string }) {
- const hasUserPermission = useHasUserPermission();
- return (
- <>{hasUserPermission(collection, "create", undefined, layer) &&
+export function PlusButton ({ layer, triggerAction, color, collection = 'items' }: { layer?: LayerProps, triggerAction: any, color: string, collection?:string }) {
+ const hasUserPermission = useHasUserPermission()
+ return (
+ <>{hasUserPermission(collection, 'create', undefined, layer) &&
-
+
}
>
- )
+ )
}
diff --git a/src/Components/Profile/Subcomponents/ProfileSubHeader.tsx b/src/Components/Profile/Subcomponents/ProfileSubHeader.tsx
index 057e6444..6b2c00de 100644
--- a/src/Components/Profile/Subcomponents/ProfileSubHeader.tsx
+++ b/src/Components/Profile/Subcomponents/ProfileSubHeader.tsx
@@ -1,5 +1,4 @@
-import SocialShareBar from './SocialShareBar';
-
+import SocialShareBar from './SocialShareBar'
/* const flags = {
de: (
@@ -19,10 +18,10 @@ import SocialShareBar from './SocialShareBar';
}; */
const statusMapping = {
- 'in_planning': 'in Planung',
- 'paused': 'pausiert',
- 'active': 'aktiv'
-};
+ in_planning: 'in Planung',
+ paused: 'pausiert',
+ active: 'aktiv'
+}
// eslint-disable-next-line react/prop-types
const SubHeader = ({ type, status, url, title }) => (
@@ -30,7 +29,7 @@ const SubHeader = ({ type, status, url, title }) => (
{status &&
- {statusMapping[status]}
+ {statusMapping[status]}
}
{type &&
{type}
@@ -40,6 +39,6 @@ const SubHeader = ({ type, status, url, title }) => (
-);
+)
-export default SubHeader;
\ No newline at end of file
+export default SubHeader
diff --git a/src/Components/Profile/Subcomponents/RelationCard.tsx b/src/Components/Profile/Subcomponents/RelationCard.tsx
index 18fc6163..ea2c294b 100644
--- a/src/Components/Profile/Subcomponents/RelationCard.tsx
+++ b/src/Components/Profile/Subcomponents/RelationCard.tsx
@@ -1,4 +1,3 @@
-
// eslint-disable-next-line react/prop-types
const RelationCard = ({ title, description, imageSrc }) => (
@@ -12,6 +11,6 @@ const RelationCard = ({ title, description, imageSrc }) => (
{description}
-);
+)
-export default RelationCard;
\ No newline at end of file
+export default RelationCard
diff --git a/src/Components/Profile/Subcomponents/SocialShareBar.tsx b/src/Components/Profile/Subcomponents/SocialShareBar.tsx
index 42efa6e4..b7fb67e8 100644
--- a/src/Components/Profile/Subcomponents/SocialShareBar.tsx
+++ b/src/Components/Profile/Subcomponents/SocialShareBar.tsx
@@ -1,8 +1,8 @@
-import SocialShareButton from './SocialShareButton';
+import SocialShareButton from './SocialShareButton'
// eslint-disable-next-line react/prop-types
-const SocialShareBar = ({url, title, platforms = ['facebook', 'twitter', 'linkedin', 'xing', 'email']}) => {
- return (
+const SocialShareBar = ({ url, title, platforms = ['facebook', 'twitter', 'linkedin', 'xing', 'email'] }) => {
+ return (
{platforms.map((platform) => (
))}
- );
-};
+ )
+}
-export default SocialShareBar;
\ No newline at end of file
+export default SocialShareBar
diff --git a/src/Components/Profile/Subcomponents/SocialShareButton.tsx b/src/Components/Profile/Subcomponents/SocialShareButton.tsx
index 7c8c0b42..0b5b2ca2 100644
--- a/src/Components/Profile/Subcomponents/SocialShareButton.tsx
+++ b/src/Components/Profile/Subcomponents/SocialShareButton.tsx
@@ -1,81 +1,81 @@
-import * as React from 'react';
+import * as React from 'react'
const platformConfigs = {
- facebook: {
- shareUrl: 'https://www.facebook.com/sharer/sharer.php?u={url}',
- icon: (
+ facebook: {
+ shareUrl: 'https://www.facebook.com/sharer/sharer.php?u={url}',
+ icon: (
- ),
- bgColor: '#3b5998'
- },
- twitter: {
- shareUrl: 'https://twitter.com/intent/tweet?text={title}:%20{url}',
- icon: (
+ ),
+ bgColor: '#3b5998'
+ },
+ twitter: {
+ shareUrl: 'https://twitter.com/intent/tweet?text={title}:%20{url}',
+ icon: (
- ),
- bgColor: '#55acee'
- },
- linkedin: {
- shareUrl: 'http://www.linkedin.com/shareArticle?mini=true&url={url}&title={title}',
- icon: (
+ ),
+ bgColor: '#55acee'
+ },
+ linkedin: {
+ shareUrl: 'http://www.linkedin.com/shareArticle?mini=true&url={url}&title={title}',
+ icon: (
- ),
- bgColor: '#4875b4'
- },
- xing: {
- shareUrl: 'https://www.xing-share.com/app/user?op=share;sc_p=xing-share;url={url}',
- icon: (
+ ),
+ bgColor: '#4875b4'
+ },
+ xing: {
+ shareUrl: 'https://www.xing-share.com/app/user?op=share;sc_p=xing-share;url={url}',
+ icon: (
- ),
- bgColor: '#026466'
- },
- email: {
- shareUrl: 'mailto:?subject={title}&body={url}',
- icon: (
+ ),
+ bgColor: '#026466'
+ },
+ email: {
+ shareUrl: 'mailto:?subject={title}&body={url}',
+ icon: (
- ),
- bgColor: '#444444'
- }
-};
+ ),
+ bgColor: '#444444'
+ }
+}
// eslint-disable-next-line react/prop-types
const SocialShareButton = ({ platform, url, title }) => {
- const config = platformConfigs[platform];
+ const config = platformConfigs[platform]
- if (!config) {
- return null;
- }
+ if (!config) {
+ return null
+ }
- const { shareUrl, icon, bgColor } = config;
- const finalShareUrl = shareUrl
- .replace('{url}', encodeURIComponent(url))
- .replace('{title}', encodeURIComponent(title));
+ const { shareUrl, icon, bgColor } = config
+ const finalShareUrl = shareUrl
+ .replace('{url}', encodeURIComponent(url))
+ .replace('{title}', encodeURIComponent(title))
- return (
+ return (
{React.cloneElement(icon, { className: 'tw-w-4 tw-h-4 tw-fill-current' })}
- );
-};
+ )
+}
-export default SocialShareButton;
\ No newline at end of file
+export default SocialShareButton
diff --git a/src/Components/Profile/Subcomponents/TagsWidget.tsx b/src/Components/Profile/Subcomponents/TagsWidget.tsx
index 4ad68386..79a71d24 100644
--- a/src/Components/Profile/Subcomponents/TagsWidget.tsx
+++ b/src/Components/Profile/Subcomponents/TagsWidget.tsx
@@ -1,99 +1,95 @@
import * as React from 'react'
-import { useEffect, useState } from 'react';
-import { useTags } from '../../Map/hooks/useTags';
-import { Tag } from '../../../types';
-import { Autocomplete } from '../../Input/Autocomplete';
-import { randomColor } from '../../../Utils/RandomColor';
-import { decodeTag, encodeTag } from '../../../Utils/FormatTags';
+import { useEffect, useState } from 'react'
+import { useTags } from '../../Map/hooks/useTags'
+import { Tag } from '../../../types'
+import { Autocomplete } from '../../Input/Autocomplete'
+import { randomColor } from '../../../Utils/RandomColor'
+import { decodeTag, encodeTag } from '../../../Utils/FormatTags'
// eslint-disable-next-line react/prop-types
-export const TagsWidget = ({placeholder, containerStyle, defaultTags, onUpdate}) => {
+export const TagsWidget = ({ placeholder, containerStyle, defaultTags, onUpdate }) => {
+ const [input, setInput] = useState('')
+ const [isKeyReleased, setIsKeyReleased] = useState(false)
+ const tags = useTags()
+ const [pushFilteredSuggestions, setPushFilteredSuggestions] = useState
>([])
- const [input, setInput] = useState('');
- const [isKeyReleased, setIsKeyReleased] = useState(false);
- const tags = useTags();
- const [pushFilteredSuggestions, setPushFilteredSuggestions] = useState>([]);
-
- const [focusInput, setFocusInput] = useState(false);
- const [currentTags, setCurrentTags] = useState>(defaultTags);
+ const [focusInput, setFocusInput] = useState(false)
+ const [currentTags, setCurrentTags] = useState>(defaultTags)
useEffect(() => {
setCurrentTags(defaultTags)
}, [defaultTags])
-
-
const onChange = (e) => {
- const { value } = e.target;
- setInput(value);
- };
+ const { value } = e.target
+ setInput(value)
+ }
const onKeyDown = (e) => {
- const { key } = e;
- const trimmedInput = input.trim();
+ const { key } = e
+ const trimmedInput = input.trim()
// eslint-disable-next-line react/prop-types
- if ((key === 'Enter' || key === ',' ) && trimmedInput.length && !defaultTags.some(tag => tag.name.toLocaleLowerCase() === trimmedInput.toLocaleLowerCase())) {
- e.preventDefault();
+ if ((key === 'Enter' || key === ',') && trimmedInput.length && !defaultTags.some(tag => tag.name.toLocaleLowerCase() === trimmedInput.toLocaleLowerCase())) {
+ e.preventDefault()
const newTag = tags.find(t => t.name === trimmedInput.toLocaleLowerCase())
- newTag && onUpdate([...currentTags, newTag]);
- !newTag && onUpdate([...currentTags, { id: crypto.randomUUID(), name: encodeTag(trimmedInput), color: randomColor() }]);
- setInput('');
- setPushFilteredSuggestions([]);
+ newTag && onUpdate([...currentTags, newTag])
+ !newTag && onUpdate([...currentTags, { id: crypto.randomUUID(), name: encodeTag(trimmedInput), color: randomColor() }])
+ setInput('')
+ setPushFilteredSuggestions([])
}
// eslint-disable-next-line react/prop-types
- if (key === "Backspace" && !input.length && defaultTags.length && isKeyReleased) {
- const defaultTagsCopy = [...defaultTags];
- const poppedTag = defaultTagsCopy.pop();
- e.preventDefault();
- onUpdate(defaultTagsCopy);
- poppedTag && setInput(poppedTag.name);
+ if (key === 'Backspace' && !input.length && defaultTags.length && isKeyReleased) {
+ const defaultTagsCopy = [...defaultTags]
+ const poppedTag = defaultTagsCopy.pop()
+ e.preventDefault()
+ onUpdate(defaultTagsCopy)
+ poppedTag && setInput(poppedTag.name)
}
- setIsKeyReleased(false);
- };
+ setIsKeyReleased(false)
+ }
const onKeyUp = () => {
- setIsKeyReleased(true);
+ setIsKeyReleased(true)
}
const deleteTag = (tag) => {
onUpdate(currentTags.filter((t) => t !== tag))
}
-
const onSelected = (tag) => {
// eslint-disable-next-line react/prop-types
- if(!defaultTags.some(t => t.name.toLocaleLowerCase() === tag.name.toLocaleLowerCase())) {
+ if (!defaultTags.some(t => t.name.toLocaleLowerCase() === tag.name.toLocaleLowerCase())) {
const newTag = tags.find(t => t.name.toLocaleLowerCase() === tag.name.toLocaleLowerCase())
- newTag && onUpdate([...currentTags, newTag]);
- !newTag && onUpdate([...currentTags, { id: crypto.randomUUID(), name: tag.name.toLocaleLowerCase(), color: randomColor() }]);
- setInput('');
- setPushFilteredSuggestions([]);
+ newTag && onUpdate([...currentTags, newTag])
+ !newTag && onUpdate([...currentTags, { id: crypto.randomUUID(), name: tag.name.toLocaleLowerCase(), color: randomColor() }])
+ setInput('')
+ setPushFilteredSuggestions([])
}
}
const inputProps = {
value: input,
- placeholder: placeholder,
- onKeyDown: onKeyDown,
- onKeyUp: onKeyUp,
- onChange: onChange,
+ placeholder,
+ onKeyDown,
+ onKeyUp,
+ onChange,
className: 'tw-bg-transparent tw-w-fit tw-mt-5 tw-h-fit'
}
/* eslint-disable react/prop-types */
return (
- {
- setFocusInput(true);
- setTimeout(()=> {
+
{
+ setFocusInput(true)
+ setTimeout(() => {
setFocusInput(false)
}, 200)
}} className={`tw-input tw-input-bordered tw-cursor-text ${containerStyle}`}>
{defaultTags.map((tag) => (
-
+
{decodeTag(tag.name)}
@@ -105,4 +101,4 @@ export const TagsWidget = ({placeholder, containerStyle, defaultTags, onUpdate})
)
/* eslint-enable react/prop-types */
-}
\ No newline at end of file
+}
diff --git a/src/Components/Profile/Templates/OnepagerForm.tsx b/src/Components/Profile/Templates/OnepagerForm.tsx
index 11dc5d96..0ab25014 100644
--- a/src/Components/Profile/Templates/OnepagerForm.tsx
+++ b/src/Components/Profile/Templates/OnepagerForm.tsx
@@ -1,8 +1,8 @@
import * as React from 'react'
-import { useEffect } from "react";
-import { Item, Tag } from "../../../types"
-import { TextAreaInput, TextInput } from "../../Input"
-import ComboBoxInput from "../../Input/ComboBoxInput"
+import { useEffect } from 'react'
+import { Item, Tag } from '../../../types'
+import { TextAreaInput, TextInput } from '../../Input'
+import ComboBoxInput from '../../Input/ComboBoxInput'
export const OnepagerForm = ({ item, state, setState }: {
state: {
@@ -25,53 +25,51 @@ export const OnepagerForm = ({ item, state, setState }: {
setState: React.Dispatch
>,
item: Item
}) => {
+ useEffect(() => {
+ switch (state.groupType) {
+ case 'wuerdekompass':
+ setState(prevState => ({
+ ...prevState,
+ color: item?.layer?.menuColor || '#1A5FB4',
+ markerIcon: 'group',
+ image: '59e6a346-d1ee-4767-9e42-fc720fb535c9'
+ }))
+ break
+ case 'themenkompass':
+ setState(prevState => ({
+ ...prevState,
+ color: '#26A269',
+ markerIcon: 'group',
+ image: '59e6a346-d1ee-4767-9e42-fc720fb535c9'
+ }))
+ break
+ case 'liebevoll.jetzt':
+ setState(prevState => ({
+ ...prevState,
+ color: '#E8B620',
+ markerIcon: 'liebevoll.jetzt',
+ image: 'e735b96c-507b-471c-8317-386ece0ca51d'
+ }))
- useEffect(() => {
- switch (state.groupType) {
- case "wuerdekompass":
- setState(prevState => ({
- ...prevState,
- color: item?.layer?.menuColor || "#1A5FB4",
- markerIcon: "group",
- image: "59e6a346-d1ee-4767-9e42-fc720fb535c9"
- }));
- break;
- case "themenkompass":
- setState(prevState => ({
- ...prevState,
- color: "#26A269",
- markerIcon: "group",
- image: "59e6a346-d1ee-4767-9e42-fc720fb535c9"
- }));
- break;
- case "liebevoll.jetzt":
- setState(prevState => ({
- ...prevState,
- color: "#E8B620",
- markerIcon: "liebevoll.jetzt",
- image: "e735b96c-507b-471c-8317-386ece0ca51d"
- }));
-
- break;
- default:
- break;
- }
+ break
+ default:
+ break
+ }
// eslint-disable-next-line react-hooks/exhaustive-deps
- }, [state.groupType])
+ }, [state.groupType])
+ const typeMapping = [
+ { value: 'wuerdekompass', label: 'Regional-Gruppe' },
+ { value: 'themenkompass', label: 'Themen-Gruppe' },
+ { value: 'liebevoll.jetzt', label: 'liebevoll.jetzt' }
+ ]
+ const statusMapping = [
+ { value: 'active', label: 'aktiv' },
+ { value: 'in_planning', label: 'in Planung' },
+ { value: 'paused', label: 'pausiert' }
+ ]
- const typeMapping = [
- { value: 'wuerdekompass', label: 'Regional-Gruppe' },
- { value: 'themenkompass', label: 'Themen-Gruppe' },
- { value: 'liebevoll.jetzt', label: 'liebevoll.jetzt' }
- ];
- const statusMapping = [
- { value: 'active', label: 'aktiv' },
- { value: 'in_planning', label: 'in Planung' },
- { value: 'paused', label: 'pausiert' }
- ];
-
- return (
+ return (
@@ -83,8 +81,8 @@ export const OnepagerForm = ({ item, state, setState }: {
options={typeMapping}
value={state.groupType}
onValueChange={(v) => setState(prevState => ({
- ...prevState,
- groupType: v
+ ...prevState,
+ groupType: v
}))}
/>
@@ -97,8 +95,8 @@ export const OnepagerForm = ({ item, state, setState }: {
options={statusMapping}
value={state.status}
onValueChange={(v) => setState(prevState => ({
- ...prevState,
- status: v
+ ...prevState,
+ status: v
}))}
/>
@@ -112,8 +110,8 @@ export const OnepagerForm = ({ item, state, setState }: {
placeholder="Email"
defaultValue={state.contact}
updateFormValue={(v) => setState(prevState => ({
- ...prevState,
- contact: v
+ ...prevState,
+ contact: v
}))}
/>
@@ -126,8 +124,8 @@ export const OnepagerForm = ({ item, state, setState }: {
placeholder="Telefonnummer"
defaultValue={state.telephone}
updateFormValue={(v) => setState(prevState => ({
- ...prevState,
- telephone: v
+ ...prevState,
+ telephone: v
}))}
/>
@@ -140,8 +138,8 @@ export const OnepagerForm = ({ item, state, setState }: {
placeholder="NΓ€chste Termine"
defaultValue={state.nextAppointment}
updateFormValue={(v) => setState(prevState => ({
- ...prevState,
- nextAppointment: v
+ ...prevState,
+ nextAppointment: v
}))}
inputStyle="tw-h-24"
/>
@@ -153,14 +151,14 @@ export const OnepagerForm = ({ item, state, setState }: {
setState(prevState => ({
- ...prevState,
- text: v
+ ...prevState,
+ text: v
}))}
inputStyle="tw-h-48"
/>
- )
+ )
}
diff --git a/src/Components/Profile/Templates/OnepagerView.tsx b/src/Components/Profile/Templates/OnepagerView.tsx
index 0f937f85..d67b4762 100644
--- a/src/Components/Profile/Templates/OnepagerView.tsx
+++ b/src/Components/Profile/Templates/OnepagerView.tsx
@@ -1,30 +1,27 @@
-import { Item } from "../../../types"
-import { TextView } from "../../Map"
-import ContactInfo from "../Subcomponents/ContactInfo"
-import ProfileSubHeader from "../Subcomponents/ProfileSubHeader"
-import { useEffect, useState } from "react"
-import { useItems } from "../../Map/hooks/useItems"
-
-export const OnepagerView = ({item, userType}:{item: Item, userType: string}) => {
-
- const [profile_owner, setProfileOwner] = useState
- ();
- const items = useItems();
-
+import { Item } from '../../../types'
+import { TextView } from '../../Map'
+import ContactInfo from '../Subcomponents/ContactInfo'
+import ProfileSubHeader from '../Subcomponents/ProfileSubHeader'
+import { useEffect, useState } from 'react'
+import { useItems } from '../../Map/hooks/useItems'
+export const OnepagerView = ({ item, userType }:{item: Item, userType: string}) => {
+ const [profile_owner, setProfileOwner] = useState
- ()
+ const items = useItems()
useEffect(() => {
- setProfileOwner(items.find(i => (i.user_created?.id === item.user_created?.id) && i.layer?.itemType.name === userType));
+ setProfileOwner(items.find(i => (i.user_created?.id === item.user_created?.id) && i.layer?.itemType.name === userType))
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [item, items])
const typeMapping = {
- 'wuerdekompass': 'Regional-Gruppe',
- 'themenkompass': 'Themenkompass-Gruppe',
- 'liebevoll.jetzt': 'liebevoll.jetzt',
-};
+ wuerdekompass: 'Regional-Gruppe',
+ themenkompass: 'Themenkompass-Gruppe',
+ 'liebevoll.jetzt': 'liebevoll.jetzt'
+ }
-const groupType = item.group_type ? item.group_type : 'default';
-const groupTypeText = typeMapping[groupType];
+ const groupType = item.group_type ? item.group_type : 'default'
+ const groupTypeText = typeMapping[groupType]
return (
@@ -56,19 +53,19 @@ const groupTypeText = typeMapping[groupType];
)};
{/* Relations Section */}
- {/*{d.relations && (*/}
- {/*
*/}
- {/*
Projekte
*/}
- {/* {d.relations.map((project, index) => (*/}
- {/* */}
- {/* ))}*/}
- {/* */}
- {/*)}*/}
+ {/* {d.relations && ( */}
+ {/*
*/}
+ {/*
Projekte
*/}
+ {/* {d.relations.map((project, index) => ( */}
+ {/* */}
+ {/* ))} */}
+ {/* */}
+ {/* )} */}
)
}
diff --git a/src/Components/Profile/Templates/SimpleForm.tsx b/src/Components/Profile/Templates/SimpleForm.tsx
index 5dd35858..d7e3d8f1 100644
--- a/src/Components/Profile/Templates/SimpleForm.tsx
+++ b/src/Components/Profile/Templates/SimpleForm.tsx
@@ -1,4 +1,4 @@
-import { TextAreaInput } from "../../Input";
+import { TextAreaInput } from '../../Input'
// eslint-disable-next-line react/prop-types
export const SimpleForm = ({ state, setState }) => {
@@ -6,7 +6,7 @@ export const SimpleForm = ({ state, setState }) => {
setState(prevState => ({
...prevState,
text: v
@@ -14,5 +14,5 @@ export const SimpleForm = ({ state, setState }) => {
containerStyle='tw-mt-8 tw-h-full'
inputStyle='tw-h-full'
/>
- );
-};
+ )
+}
diff --git a/src/Components/Profile/Templates/SimpleView.tsx b/src/Components/Profile/Templates/SimpleView.tsx
index 3ae5f5a8..6a11c03e 100644
--- a/src/Components/Profile/Templates/SimpleView.tsx
+++ b/src/Components/Profile/Templates/SimpleView.tsx
@@ -2,7 +2,7 @@ import * as React from 'react'
import { TextView } from '../../Map'
import { Item } from '../../../types'
-export const SimpleView = ({item}:{item: Item}) => {
+export const SimpleView = ({ item }:{item: Item}) => {
return (
diff --git a/src/Components/Profile/Templates/TabsForm.tsx b/src/Components/Profile/Templates/TabsForm.tsx
index ea138dbb..ab751435 100644
--- a/src/Components/Profile/Templates/TabsForm.tsx
+++ b/src/Components/Profile/Templates/TabsForm.tsx
@@ -1,73 +1,72 @@
/* eslint-disable react/prop-types */
-import { useCallback, useEffect, useState } from "react"
-import { TextAreaInput } from "../../Input"
-import { PopupStartEndInput, TextView } from "../../Map"
-import { ActionButton } from "../Subcomponents/ActionsButton"
-import { LinkedItemsHeaderView } from "../Subcomponents/LinkedItemsHeaderView"
-import { TagsWidget } from "../Subcomponents/TagsWidget"
-import { useNavigate } from "react-router-dom"
-import { useUpdateItem } from "../../Map/hooks/useItems"
+import { useCallback, useEffect, useState } from 'react'
+import { TextAreaInput } from '../../Input'
+import { PopupStartEndInput, TextView } from '../../Map'
+import { ActionButton } from '../Subcomponents/ActionsButton'
+import { LinkedItemsHeaderView } from '../Subcomponents/LinkedItemsHeaderView'
+import { TagsWidget } from '../Subcomponents/TagsWidget'
+import { useNavigate } from 'react-router-dom'
+import { useUpdateItem } from '../../Map/hooks/useItems'
// eslint-disable-next-line react/prop-types
export const TabsForm = ({ item, state, setState, updatePermission, linkItem, unlinkItem, loading, setUrlParams }) => {
+ const [activeTab, setActiveTab] = useState
(1)
+ const navigate = useNavigate()
+ const updateItem = useUpdateItem()
- const [activeTab, setActiveTab] = useState(1);
- const navigate = useNavigate();
- const updateItem = useUpdateItem();
+ const updateActiveTab = useCallback((id: number) => {
+ setActiveTab(id)
- const updateActiveTab = useCallback((id: number) => {
- setActiveTab(id);
+ const params = new URLSearchParams(window.location.search)
- const params = new URLSearchParams(window.location.search);
-
- params.set("tab", `${id}`);
- const newUrl = location.pathname + "?" + params.toString();
- window.history.pushState({}, '', newUrl);
- setUrlParams(params);
+ params.set('tab', `${id}`)
+ const newUrl = location.pathname + '?' + params.toString()
+ window.history.pushState({}, '', newUrl)
+ setUrlParams(params)
// eslint-disable-next-line react-hooks/exhaustive-deps
- }, [location.pathname]);
+ }, [location.pathname])
- useEffect(() => {
- const params = new URLSearchParams(location.search);
- const urlTab = params.get("tab");
- setActiveTab(urlTab ? Number(urlTab) : 1);
+ useEffect(() => {
+ const params = new URLSearchParams(location.search)
+ const urlTab = params.get('tab')
+ setActiveTab(urlTab ? Number(urlTab) : 1)
// eslint-disable-next-line react-hooks/exhaustive-deps
- }, [location.search]);
+ }, [location.search])
- return (
+ return (