Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

1.2 KB
Raw Blame
import { useState } from 'react';

import { useT } from '../../lib/i18n/I18nContext';
import WhatLeavesMyComputerSheet from './WhatLeavesMyComputerSheet';

interface WhatLeavesLinkProps {
  label?: string;
  className?: string;
}

/**
 * Inline "what leaves my computer?" trigger. Place near any screen that may
 * cause a network call (model download, skill connect, provider selection).
 * Invisible when not needed, one click away when it is.
 */
const WhatLeavesLink = ({ label, className }: WhatLeavesLinkProps) => {
  const { t } = useT();
  const resolvedLabel = label ?? t('privacy.whatLeaves.link.label');
  const [open, setOpen] = useState(false);
  const base =
    'text-sm text-content-muted underline underline-offset-2 hover:text-content-secondary ' +
    'focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-500/25 ' +
    'focus-visible:ring-offset-2 rounded-sm';
  return (
    <>
      <button
        type="button"
        className={[base, className ?? ''].filter(Boolean).join(' ')}
        onClick={() => setOpen(true)}>
        {resolvedLabel}
      </button>
      <WhatLeavesMyComputerSheet open={open} onClose={() => setOpen(false)} />
    </>
  );
};

export default WhatLeavesLink;