'use client'; import { MiniButton } from '@/components/Control'; import { type DomIconProps } from '@/components/DomainIcons'; import { Dropdown, DropdownButton, useDropdown } from '@/components/Dropdown'; import { IconPrivate, IconProtected, IconPublic } from '@/components/Icons'; import { type Styling } from '@/components/props'; import { prefixes } from '@/utils/constants'; import { AccessPolicy } from '../backend/types'; import { describeAccessPolicy, labelAccessPolicy } from '../labels'; interface SelectAccessPolicyProps extends Styling { value: AccessPolicy; onChange: (value: AccessPolicy) => void; disabled?: boolean; stretchLeft?: boolean; } export function SelectAccessPolicy({ value, disabled, stretchLeft, onChange, ...restProps }: SelectAccessPolicyProps) { const menu = useDropdown(); function handleChange(newValue: AccessPolicy) { menu.hide(); if (newValue !== value) { onChange(newValue); } } return (