fix: update shortcut

This commit is contained in:
Steven
2023-12-23 23:52:44 +08:00
parent b73f7070e4
commit 546d87ca0b
28 changed files with 1607 additions and 1345 deletions

View File

@ -6,18 +6,18 @@ import { GetShortcutAnalyticsResponse } from "@/types/proto/api/v2/shortcut_serv
import Icon from "./Icon";
interface Props {
shortcutName: string;
shortcutId: number;
className?: string;
}
const AnalyticsView: React.FC<Props> = (props: Props) => {
const { shortcutName, className } = props;
const { shortcutId, className } = props;
const { t } = useTranslation();
const [analytics, setAnalytics] = useState<GetShortcutAnalyticsResponse | null>(null);
const [selectedDeviceTab, setSelectedDeviceTab] = useState<"os" | "browser">("browser");
useEffect(() => {
shortcutServiceClient.getShortcutAnalytics({ name: shortcutName }).then((response) => {
shortcutServiceClient.getShortcutAnalytics({ id: shortcutId }).then((response) => {
setAnalytics(response);
});
}, []);