import { useState } from "react"; import { type RadioChangeEvent, Space } from "antd" import { Radio } from "antd"; import type { ISentence } from "../SentEdit" import { SuggestionIcon } from "../../../assets/icon"; import SuggestionAdd from "./SuggestionAdd"; import SuggestionList from "./SuggestionList"; interface IWidget { data: ISentence; } const SuggestionTabsWidget = ({ data }: IWidget) => { const [value, setValue] = useState("close"); const [showSuggestion, setShowSuggestion] = useState(false); const onChange = ({ target: { value } }: RadioChangeEvent) => { console.log("radio1 checked", value); switch (value) { case "suggestion": setShowSuggestion(true); break; } setValue(value); }; return (
{ if (value === "suggestion") { setValue("close"); } }} style={{ border: "none", backgroundColor: "wheat", borderRadius: 5, }} > {data.suggestionCount?.suggestion}
{showSuggestion ? (
) : ( <> )}
); }; export default SuggestionTabsWidget;