import * as React from "react"; import { useTranslation } from "react-i18next"; import styled from "styled-components"; import { s } from "@shared/styles"; import { CollectionPermission } from "@shared/types"; import { InputSelectNew, Option as OptionNew, } from "~/components/InputSelectNew"; import { EmptySelectValue } from "~/types"; type Props = { shrink?: boolean; } & Pick< React.ComponentProps, "value" | "onChange" | "disabled" | "hideLabel" | "nude" | "help" >; export const InputSelectPermission = React.forwardRef( (props, ref) => { const { value, onChange, shrink, ...rest } = props; const { t } = useTranslation(); const options = React.useMemo( () => [ { type: "item", label: t("View only"), value: CollectionPermission.Read, }, { type: "item", label: t("Can edit"), value: CollectionPermission.ReadWrite, }, { type: "separator", }, { type: "item", label: t("No access"), value: EmptySelectValue, }, ], [t] ); return (