mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-17 09:30:58 -07:00
27 lines
564 B
TypeScript
27 lines
564 B
TypeScript
/**
|
|
* @license
|
|
* Copyright 2026 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import { useEffect, useState } from 'react';
|
|
import { persistentState } from '../../utils/persistentState.js';
|
|
|
|
interface UseTipsResult {
|
|
showTips: boolean;
|
|
}
|
|
|
|
export function useTips(): UseTipsResult {
|
|
const [tipsCount] = useState(() => persistentState.get('tipsShown') ?? 0);
|
|
|
|
const showTips = tipsCount < 10;
|
|
|
|
useEffect(() => {
|
|
if (showTips) {
|
|
persistentState.set('tipsShown', tipsCount + 1);
|
|
}
|
|
}, [tipsCount, showTips]);
|
|
|
|
return { showTips };
|
|
}
|