chore: add shortcut space routes

This commit is contained in:
Steven
2023-12-17 23:27:01 +08:00
parent 43cda4e2fb
commit fb7fc2443f
21 changed files with 647 additions and 493 deletions

View File

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