Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

973 B
Raw Blame
import { useRef } from "react";
import { useTranslation } from "react-i18next";
import { ComposerSheet } from "./ComposerSheet";
import { MobilePermissionPickerList } from "./MobilePermissionPickerList";
import type { NativePermissionSheetProps } from "./NativePermissionSheet";
export function NativePermissionSheet(props: NativePermissionSheetProps) {
  const { t } = useTranslation();
  const pending = useRef<(() => void) | null>(null);
  return (
    <ComposerSheet
      nativeContent
      visible={props.visible}
      onClose={props.onClose}
      onClosed={() => {
        const action = pending.current;
        pending.current = null;
        action?.();
      }}
      title={t("models.picker.permissionTitle")}
      testID={props.testID}
    >
      <MobilePermissionPickerList
        {...props}
        onSelect={(mode) => {
          pending.current = () => props.onSelect(mode);
          props.onClose();
        }}
      />
    </ComposerSheet>
  );
}