'use client';
import { getTranslation } from '@payloadcms/translations';
import React from 'react';
import { useTranslation } from '../../../../providers/Translation/index.js';
const baseClass = 'radio-input';
export const Radio = (props)=>{
    const { isSelected, onChange, option, path, uuid } = props;
    const { i18n } = useTranslation();
    const id = `field-${path}-${option.value}${uuid ? `-${uuid}` : ''}`;
    return /*#__PURE__*/ React.createElement("label", {
        htmlFor: id
    }, /*#__PURE__*/ React.createElement("div", {
        className: [
            baseClass,
            isSelected && `${baseClass}--is-selected`
        ].filter(Boolean).join(' ')
    }, /*#__PURE__*/ React.createElement("input", {
        checked: isSelected,
        id: id,
        onChange: ()=>typeof onChange === 'function' ? onChange(option.value) : null,
        type: "radio"
    }), /*#__PURE__*/ React.createElement("span", {
        className: `${baseClass}__styled-radio`
    }), /*#__PURE__*/ React.createElement("span", {
        className: `${baseClass}__label`
    }, getTranslation(option.label, i18n))));
};

//# sourceMappingURL=index.js.map