/** * Copyright (c) 2021 lingdocs.com * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * */ import { CSSProperties, useState, } from "react"; import { pickPersInf, hasPersInfs, noPersInfs, } from "../../lib/misc-helpers"; import VerbInfoItemDisplay from "./VerbInfoItemDisplay"; import PersonInfsPicker from "../PersInfsPicker"; import VerbTypeInfo from "./VerbTypeInfo"; import Hider from "../Hider"; import * as T from "../../types"; import fadedTree from "./faded-tree.svg"; // import camera from "../icons/camera-fill"; // import video from "../icons/camera-video-fill"; const indentR = { paddingLeft: "1rem", }; const highlight = { background: "rgba(255, 227, 10, 0.6)", }; const title: CSSProperties = { fontWeight: "bolder", marginBottom: "0.5rem", marginTop: "0.5rem", }; export function RootsAndStems({ textOptions, info, hidePastParticiple, highlighted }: { textOptions: T.TextOptions, info: T.NonComboVerbInfo, hidePastParticiple?: boolean, highlighted?: T.RootsOrStemsToHighlight, }) { const hasPerfectiveSplit = !!(info.root.perfectiveSplit || info.stem.perfectiveSplit); const showPersInf = hasPersInfs(info); const [persInf, setPersInf] = useState("mascSing"); const [split, setSplit] = useState(false); const perfectiveStem = (info.stem.perfectiveSplit && split) ? info.stem.perfectiveSplit : info.stem.perfective; const perfectiveRoot = (info.root.perfectiveSplit && split) ? info.root.perfectiveSplit : info.root.perfective; const colClass = "col col-md-5 px-0 mb-1"; const rowClass = "row justify-content-between"; return (
{showPersInf && setPersInf(p)} transitivity={info.transitivity} />}
{/*
{info.def}
{info.subDef &&
{info.subDef}
} */}
{hasPerfectiveSplit &&
}
Imperfective Stem
Perfective Stem
Imperfective Root
Perfective Root
{!hidePastParticiple &&
Past Participle
}
); } function VerbInfo({ info, textOptions, showingStemsAndRoots, toggleShowingSar, highlightInRootsAndStems, hidePastParticiple, hideTypeInfo }: { info: T.NonComboVerbInfo, textOptions: T.TextOptions, showingStemsAndRoots: boolean, highlightInRootsAndStems?: T.RootsOrStemsToHighlight, toggleShowingSar: () => void, hidePastParticiple?: boolean, hideTypeInfo?: boolean, }) { const inf = noPersInfs(info.root.imperfective).long; return (
{!hideTypeInfo && }
); } export default VerbInfo;