Some checks failed
CI / test (map[image:macos-latest name:macos], 1, 4) (push) Has been cancelled
CI / test (map[image:macos-latest name:macos], 2, 4) (push) Has been cancelled
CI / test (map[image:macos-latest name:macos], 3, 4) (push) Has been cancelled
CI / test (map[image:macos-latest name:macos], 4, 4) (push) Has been cancelled
CI / test (map[image:windows-latest name:windows], 1, 4) (push) Has been cancelled
CI / test (map[image:windows-latest name:windows], 2, 4) (push) Has been cancelled
CI / test (map[image:windows-latest name:windows], 3, 4) (push) Has been cancelled
CI / test (map[image:windows-latest name:windows], 4, 4) (push) Has been cancelled
CI / merge-reports (push) Has been cancelled
- Added a new integration script to manage custom features related to smart context. - Implemented handlers for smart context operations (get, update, clear, stats) in ipc. - Created a SmartContextStore class to manage context snippets and summaries. - Developed hooks for React to interact with smart context (useSmartContext, useUpdateSmartContext, useClearSmartContext, useSmartContextStats). - Included backup and restore functionality in the integration script. - Validated integration by checking for custom modifications and file existence.
39 lines
899 B
TypeScript
39 lines
899 B
TypeScript
import { Button } from "@/components/ui/button";
|
|
import { toast } from "sonner";
|
|
import { useSettings } from "@/hooks/useSettings";
|
|
|
|
interface NeonDisconnectButtonProps {
|
|
className?: string;
|
|
}
|
|
|
|
export function NeonDisconnectButton({ className }: NeonDisconnectButtonProps) {
|
|
const { updateSettings, settings } = useSettings();
|
|
|
|
const handleDisconnect = async () => {
|
|
try {
|
|
await updateSettings({
|
|
neon: undefined,
|
|
});
|
|
toast.success("Disconnected from Neon successfully");
|
|
} catch (error) {
|
|
console.error("Failed to disconnect from Neon:", error);
|
|
toast.error("Failed to disconnect from Neon");
|
|
}
|
|
};
|
|
|
|
if (!settings?.neon?.accessToken) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<Button
|
|
variant="destructive"
|
|
onClick={handleDisconnect}
|
|
className={className}
|
|
size="sm"
|
|
>
|
|
Disconnect from Neon
|
|
</Button>
|
|
);
|
|
}
|