fix: update visibility scope types to global/private
This commit is contained in:
@@ -14,7 +14,7 @@ interface AgentVisibilityCardProps {
|
|||||||
|
|
||||||
const VISIBILITY_OPTIONS: { value: VisibilityScope; label: string; description: string; icon: React.ReactNode }[] = [
|
const VISIBILITY_OPTIONS: { value: VisibilityScope; label: string; description: string; icon: React.ReactNode }[] = [
|
||||||
{
|
{
|
||||||
value: 'city',
|
value: 'global',
|
||||||
label: 'Публічний',
|
label: 'Публічний',
|
||||||
description: 'Видимий всім у міських сервісах',
|
description: 'Видимий всім у міських сервісах',
|
||||||
icon: <Globe className="w-4 h-4" />,
|
icon: <Globe className="w-4 h-4" />,
|
||||||
@@ -26,7 +26,7 @@ const VISIBILITY_OPTIONS: { value: VisibilityScope; label: string; description:
|
|||||||
icon: <Users className="w-4 h-4" />,
|
icon: <Users className="w-4 h-4" />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: 'owner_only',
|
value: 'private',
|
||||||
label: 'Приватний',
|
label: 'Приватний',
|
||||||
description: 'Видимий тільки власнику',
|
description: 'Видимий тільки власнику',
|
||||||
icon: <Lock className="w-4 h-4" />,
|
icon: <Lock className="w-4 h-4" />,
|
||||||
@@ -51,9 +51,9 @@ export function AgentVisibilityCard({
|
|||||||
setScope(newScope);
|
setScope(newScope);
|
||||||
setError(null);
|
setError(null);
|
||||||
|
|
||||||
// If changing to non-city, auto-unlist from directory
|
// If changing to non-global, auto-unlist from directory
|
||||||
const newListed = newScope === 'city' ? listed : false;
|
const newListed = newScope === 'global' ? listed : false;
|
||||||
if (newScope !== 'city') {
|
if (newScope !== 'global') {
|
||||||
setListed(false);
|
setListed(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,7 +72,7 @@ export function AgentVisibilityCard({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleListedChange = async (checked: boolean) => {
|
const handleListedChange = async (checked: boolean) => {
|
||||||
if (readOnly || saving || scope !== 'city') return;
|
if (readOnly || saving || scope !== 'global') return;
|
||||||
|
|
||||||
setListed(checked);
|
setListed(checked);
|
||||||
setError(null);
|
setError(null);
|
||||||
@@ -134,8 +134,8 @@ export function AgentVisibilityCard({
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Citizens Directory toggle - only for city visibility */}
|
{/* Citizens Directory toggle - only for global visibility */}
|
||||||
{scope === 'city' && (
|
{scope === 'global' && (
|
||||||
<div className="mt-4 pt-4 border-t border-white/10">
|
<div className="mt-4 pt-4 border-t border-white/10">
|
||||||
<label className="flex items-center gap-3 cursor-pointer">
|
<label className="flex items-center gap-3 cursor-pointer">
|
||||||
<input
|
<input
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ export interface AgentPublicProfile {
|
|||||||
public_district?: string | null;
|
public_district?: string | null;
|
||||||
public_primary_room_slug?: string | null;
|
public_primary_room_slug?: string | null;
|
||||||
// Visibility settings
|
// Visibility settings
|
||||||
visibility_scope?: 'city' | 'microdao' | 'owner_only';
|
visibility_scope?: 'global' | 'microdao' | 'private';
|
||||||
is_listed_in_directory?: boolean;
|
is_listed_in_directory?: boolean;
|
||||||
is_system?: boolean;
|
is_system?: boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user