@fortawesome/free-solid-svg-icons#faStopwatch TypeScript Examples

The following examples show how to use @fortawesome/free-solid-svg-icons#faStopwatch. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: handleDurationSection.tsx    From apps with MIT License 5 votes vote down vote up
export default function handleDurationSection(
    region: Region,
    sections: FuncDescriptorSections,
    func: Func.BasicFunc,
    dataVal: DataVal.DataVal
): void {
    const section = sections.duration,
        parts = section.parts,
        shortDescription =
            func.funcType === Func.FuncType.ADD_STATE_SHORT ? (
                <>
                    {" "}
                    <FontAwesomeIcon icon={faStopwatch} title="Short Duration Buff" />
                </>
            ) : (
                <></>
            );

    if (dataVal.Count && dataVal.Count > 0 && dataVal.Turn && dataVal.Turn > 0) {
        const countDesc = dataVal.Count === 1 ? "1 Time" : `${dataVal.Count} Times`,
            turnDesc = dataVal.Turn === 1 ? "1 Turn" : `${dataVal.Turn} Turns`;

        parts.push(
            <>
                ({countDesc}, {turnDesc}
                {shortDescription})
            </>
        );
    } else if (dataVal.Turn && dataVal.Turn > 0) {
        parts.push(
            <>
                ({dataVal.Turn} Turn{dataVal.Turn > 1 ? "s" : ""}
                {shortDescription})
            </>
        );
    } else if (dataVal.Count && dataVal.Count > 0) {
        parts.push(dataVal.Count === 1 ? "(1 Time)" : `(${dataVal.Count} Times)`);
    } else {
        section.showing = false;
    }
}