New source found from dndbeyond.com
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import clsx from "clsx";
|
||||
import { FC, HTMLAttributes } from "react";
|
||||
|
||||
import { DeathCauseEnum, DefaultCharacterName } from "~/constants";
|
||||
import { useCharacterEngine } from "~/hooks/useCharacterEngine";
|
||||
|
||||
import styles from "./styles.module.css";
|
||||
|
||||
export interface CharacterNameProps extends HTMLAttributes<HTMLDivElement> {}
|
||||
|
||||
export const CharacterName: FC<CharacterNameProps> = ({
|
||||
className,
|
||||
...props
|
||||
}) => {
|
||||
const { deathCause, characterName } = useCharacterEngine();
|
||||
|
||||
return (
|
||||
<h1 className={clsx([styles.characterName, className])} {...props}>
|
||||
{deathCause !== DeathCauseEnum.NONE && "(Dead) "}
|
||||
{characterName || DefaultCharacterName}
|
||||
</h1>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user