- {item.layer?.itemType.onepager &&
- <>
- {item.user_created.first_name && (
-
- )}
+ {template == "onepager" &&
+ <>
+ {item.user_created.first_name && (
+
+ )}
- {/* Description Section */}
-
-
-
-
- {/* Next Appointment Section */}
- {item.next_appointment && (
-
-
Nächste Termine
-
-
-
+ {/* Description Section */}
+
+
- )};
- {/* Relations Section */}
- {/*{d.relations && (*/}
- {/*
*/}
- {/*
Projekte
*/}
- {/* {d.relations.map((project, index) => (*/}
- {/* */}
- {/* ))}*/}
- {/* */}
- {/*)}*/}
- >
- }
+ {/* Next Appointment Section */}
+ {item.next_appointment && (
+
+
Nächste Termine
+
+
+
+
+ )};
- {!item.layer?.itemType.onepager &&
+ {/* Relations Section */}
+ {/*{d.relations && (*/}
+ {/*
*/}
+ {/*
Projekte
*/}
+ {/* {d.relations.map((project, index) => (*/}
+ {/* */}
+ {/* ))}*/}
+ {/* */}
+ {/*)}*/}
+ >
+ }
+
+ {template == "simple" &&
+
+
+
+ }
+
+ {template == "tabs" &&
updateActiveTab(1)}/>
+ className={`tw-tab [--tab-border-color:var(--fallback-bc,oklch(var(--bc)/0.2))]`}
+ aria-label="Info" checked={activeTab == 1 && true}
+ onChange={() => updateActiveTab(1)} />
+ className="tw-tab-content tw-bg-base-100 tw-rounded-box tw-h-[calc(100dvh-280px)] tw-overflow-y-auto fade tw-pt-2 tw-pb-4 tw-mb-4 tw-overflow-x-hidden">
{item.layer?.itemType.show_start_end &&
}
-
+
- {item.layer?.itemType.offers_and_needs &&
+ {item.layer?.itemType.offers_and_needs &&
- <>
+ <>
-
updateActiveTab(3)} />
-
-
-
- {
- offers.length > 0 ?
-
-
Offers
- < div className='tw-flex tw-flex-wrap tw-mb-4'>
- {
- offers.map(o => {
- console.log(o);
- addFilterTag(o)
- }} />)
- }
-
-
: ""
- }
- {
- needs.length > 0 ?
-
-
Needs
- < div className='tw-flex tw-flex-wrap tw-mb-4'>
- {
- needs.map(n => addFilterTag(n)} />)
- }
-
-
: ""
- }
+
updateActiveTab(3)} />
+
+
+
+ {
+ offers.length > 0 ?
+
+
Offers
+ < div className='tw-flex tw-flex-wrap tw-mb-4'>
+ {
+ offers.map(o => {
+ console.log(o);
+ addFilterTag(o)
+ }} />)
+ }
+
+
: ""
+ }
+ {
+ needs.length > 0 ?
+
+
Needs
+ < div className='tw-flex tw-flex-wrap tw-mb-4'>
+ {
+ needs.map(n => addFilterTag(n)} />)
+ }
+
+
: ""
+ }
+
-
- >
+ >
- }
+ }
- {item.layer?.itemType.relations &&
- <>
-
updateActiveTab(7)} />
-
-
-
- {relations && relations.map(i =>
+ {item.layer?.itemType.relations &&
+ <>
+
updateActiveTab(7)} />
+
+
+
+ {relations && relations.map(i =>
-
navigate('/item/' + i.id)}>
-
-
-
+
navigate('/item/' + i.id)}>
+
+
+
+
-
- )}
- {updatePermission &&
}
+ )}
+ {updatePermission &&
}
+
-
- >
- }
-
+ >
+ }
+
}
>
diff --git a/src/Components/Profile/OverlayItemProfileSettings.tsx b/src/Components/Profile/OverlayItemProfileSettings.tsx
index a1974c37..77940f8d 100644
--- a/src/Components/Profile/OverlayItemProfileSettings.tsx
+++ b/src/Components/Profile/OverlayItemProfileSettings.tsx
@@ -23,7 +23,7 @@ import { useHasUserPermission } from '../Map/hooks/usePermissions';
-export function OverlayItemProfileSettings() {
+export function OverlayItemProfileSettings({ userType }: { userType: string }) {
const typeMapping = [
{ value: 'wuerdekompass', label: 'Regional-Gruppe' },
@@ -112,7 +112,7 @@ export function OverlayItemProfileSettings() {
const item = items.find(i => i.id === itemId);
item && setItem(item);
- const layer = layers.find(l => l.itemType.name == "user")
+ const layer = layers.find(l => l.itemType.name == userType)
!item && setItem({ id: crypto.randomUUID(), name: user ? user.first_name : "", text: "", layer: layer, new: true })
@@ -203,7 +203,7 @@ export function OverlayItemProfileSettings() {
position: item.position,
contact: contact,
telephone: telephone,
- ...markerIcon && {markerIcon: markerIcon},
+ ...markerIcon && { markerIcon: markerIcon },
next_appointment: nextAppointment,
...image.length > 10 && { image: image },
...offers.length > 0 && { offers: offer_updates },
@@ -314,10 +314,11 @@ export function OverlayItemProfileSettings() {
}
- useEffect(() => {
- console.log(item);
+ const [template, setTemplate] = useState
("")
- }, [item])
+ useEffect(() => {
+ setTemplate(item.layer?.itemType.template || userType);
+ }, [userType, item])
@@ -335,7 +336,7 @@ export function OverlayItemProfileSettings() {