Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

1.4 KB
Raw Blame
import { Eye, EyeOff } from 'lucide-react';
import { useTranslation } from 'react-i18next';

import { Button } from '@/components/ui/button';
import { cn } from '@/lib/utils';
import { setSourceDetailsHidden, useSourceDetailsHidden } from './sourcePrivacyPreference';

export function SourcePrivateValue({ value, className }: { value: string; className?: string }) {
  const { t } = useTranslation();
  const hidden = useSourceDetailsHidden();
  return (
    <span className={cn('block min-w-0 truncate font-mono', className)} title={hidden ? undefined : value}>
      {hidden ? <span className="flex min-w-0 items-center gap-1">
        <EyeOff className="size-3 shrink-0" aria-hidden="true" />
        <span className="truncate">{t('settings.models.upstream.hiddenDetails')}</span>
      </span> : value}
    </span>
  );
}

export function SourcePrivacyToggle() {
  const { t } = useTranslation();
  const hidden = useSourceDetailsHidden();
  const action = t(hidden ? 'settings.models.upstream.showPrivateDetails' : 'settings.models.upstream.hidePrivateDetails');
  return (
    <Button
      type="button"
      variant="ghost"
      size="icon"
      className="size-6 shrink-0 text-muted"
      aria-label={action}
      title={action}
      onClick={() => setSourceDetailsHidden(!hidden)}
    >
      {hidden ? <Eye className="size-3.5" /> : <EyeOff className="size-3.5" />}
    </Button>
  );
}