event photo wasserzeichen umgesetzt. Event admins können eigene einsetzen (als branding) falls das Paket es erlaubt. der Super Admin kann für die günstigen Pakete eigene Wasserzeichen erzwingen
This commit is contained in:
@@ -14,7 +14,7 @@ import MarketingLayout from '@/layouts/mainWebsite';
|
||||
import { useAnalytics } from '@/hooks/useAnalytics';
|
||||
import { useCtaExperiment } from '@/hooks/useCtaExperiment';
|
||||
import { useLocalizedRoutes } from '@/hooks/useLocalizedRoutes';
|
||||
import { ArrowRight, Check, Shield, Star, Sparkles } from 'lucide-react';
|
||||
import { ArrowRight, Check, Star } from 'lucide-react';
|
||||
|
||||
interface Package {
|
||||
id: number;
|
||||
@@ -46,6 +46,39 @@ interface PackageComparisonProps {
|
||||
variant: 'endcustomer' | 'reseller';
|
||||
}
|
||||
|
||||
const buildDisplayFeatures = (pkg: Package): string[] => {
|
||||
const features = [...pkg.features];
|
||||
|
||||
const removeFeature = (key: string) => {
|
||||
const index = features.indexOf(key);
|
||||
if (index !== -1) {
|
||||
features.splice(index, 1);
|
||||
}
|
||||
};
|
||||
|
||||
const addFeature = (key: string) => {
|
||||
if (!features.includes(key)) {
|
||||
features.push(key);
|
||||
}
|
||||
};
|
||||
|
||||
if (pkg.watermark_allowed === false) {
|
||||
removeFeature('watermark');
|
||||
addFeature('no_watermark');
|
||||
} else {
|
||||
removeFeature('no_watermark');
|
||||
addFeature('watermark');
|
||||
}
|
||||
|
||||
if (pkg.branding_allowed) {
|
||||
addFeature('custom_branding');
|
||||
} else {
|
||||
removeFeature('custom_branding');
|
||||
}
|
||||
|
||||
return Array.from(new Set(features));
|
||||
};
|
||||
|
||||
function PackageComparison({ packages, variant }: PackageComparisonProps) {
|
||||
const { t } = useTranslation('marketing');
|
||||
const { t: tCommon } = useTranslation('common');
|
||||
@@ -547,7 +580,9 @@ function PackageCard({
|
||||
? t('packages.badge_starter')
|
||||
: null;
|
||||
|
||||
const keyFeatures = pkg.features.slice(0, 3);
|
||||
const displayFeatures = buildDisplayFeatures(pkg);
|
||||
const keyFeatures = displayFeatures.slice(0, 3);
|
||||
const visibleFeatures = compact ? displayFeatures.slice(0, 3) : displayFeatures.slice(0, 5);
|
||||
const metrics = resolvePackageMetrics(pkg, variant, t, tCommon);
|
||||
|
||||
const metricList = compact ? (
|
||||
@@ -572,45 +607,21 @@ function PackageCard({
|
||||
|
||||
const featureList = compact ? (
|
||||
<ul className="space-y-1 text-sm text-gray-700">
|
||||
{keyFeatures.map((feature) => (
|
||||
{visibleFeatures.map((feature) => (
|
||||
<li key={feature} className="flex items-start gap-2 text-xs">
|
||||
<Check className="mt-0.5 h-3.5 w-3.5 text-gray-900" />
|
||||
<span>{t(`packages.feature_${feature}`)}</span>
|
||||
</li>
|
||||
))}
|
||||
{pkg.watermark_allowed === false && (
|
||||
<li className="flex items-start gap-2 text-xs">
|
||||
<Shield className="mt-0.5 h-3.5 w-3.5 text-gray-900" />
|
||||
<span>{t('packages.no_watermark')}</span>
|
||||
</li>
|
||||
)}
|
||||
{pkg.branding_allowed && (
|
||||
<li className="flex items-start gap-2 text-xs">
|
||||
<Sparkles className="mt-0.5 h-3.5 w-3.5 text-gray-900" />
|
||||
<span>{t('packages.custom_branding')}</span>
|
||||
</li>
|
||||
)}
|
||||
</ul>
|
||||
) : (
|
||||
<ul className="space-y-2 text-sm text-gray-700">
|
||||
{keyFeatures.map((feature) => (
|
||||
{visibleFeatures.map((feature) => (
|
||||
<li key={feature} className="flex items-center gap-2">
|
||||
<Check className="h-4 w-4 text-gray-900" />
|
||||
<span>{t(`packages.feature_${feature}`)}</span>
|
||||
</li>
|
||||
))}
|
||||
{pkg.watermark_allowed === false && (
|
||||
<li className="flex items-center gap-2">
|
||||
<Shield className="h-4 w-4 text-gray-900" />
|
||||
<span>{t('packages.no_watermark')}</span>
|
||||
</li>
|
||||
)}
|
||||
{pkg.branding_allowed && (
|
||||
<li className="flex items-center gap-2">
|
||||
<Sparkles className="h-4 w-4 text-gray-900" />
|
||||
<span>{t('packages.custom_branding')}</span>
|
||||
</li>
|
||||
)}
|
||||
</ul>
|
||||
);
|
||||
|
||||
@@ -703,6 +714,10 @@ const PackageDetailGrid: React.FC<PackageDetailGridProps> = ({
|
||||
close,
|
||||
}) => {
|
||||
const metrics = resolvePackageMetrics(packageData, variant, t, tCommon);
|
||||
const highlightFeatures = useMemo(
|
||||
() => buildDisplayFeatures(packageData).slice(0, 5),
|
||||
[packageData],
|
||||
);
|
||||
|
||||
return (
|
||||
<div className="grid gap-8 lg:grid-cols-[320px,1fr]">
|
||||
@@ -757,24 +772,12 @@ const PackageDetailGrid: React.FC<PackageDetailGridProps> = ({
|
||||
<div className="rounded-2xl border border-gray-100 bg-white p-6">
|
||||
<h3 className="text-lg font-semibold text-gray-900">{t('packages.feature_highlights')}</h3>
|
||||
<ul className="mt-4 space-y-3 text-sm text-gray-700">
|
||||
{packageData.features.slice(0, 5).map((feature) => (
|
||||
{highlightFeatures.map((feature) => (
|
||||
<li key={feature} className="flex items-start gap-2">
|
||||
<Check className="mt-1 h-4 w-4 text-gray-900" />
|
||||
<span>{t(`packages.feature_${feature}`)}</span>
|
||||
</li>
|
||||
))}
|
||||
{packageData.watermark_allowed === false && (
|
||||
<li className="flex items-start gap-2">
|
||||
<Shield className="mt-1 h-4 w-4 text-gray-900" />
|
||||
<span>{t('packages.no_watermark')}</span>
|
||||
</li>
|
||||
)}
|
||||
{packageData.branding_allowed && (
|
||||
<li className="flex items-start gap-2">
|
||||
<Sparkles className="mt-1 h-4 w-4 text-gray-900" />
|
||||
<span>{t('packages.custom_branding')}</span>
|
||||
</li>
|
||||
)}
|
||||
</ul>
|
||||
</div>
|
||||
<div className="rounded-2xl border border-gray-100 bg-white p-6">
|
||||
|
||||
Reference in New Issue
Block a user