zenno/doc/frbm: update with charts &c.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<script lang="ts">
|
||||
import { skills, ZERO_SKILL, type Skill } from "./data/skill";
|
||||
|
||||
interface CommonProps {
|
||||
hint?: string;
|
||||
mention?: boolean;
|
||||
}
|
||||
|
||||
type Props = CommonProps & ({skill: number, name?: never} | {name: string, skill?: never});
|
||||
|
||||
let {hint, mention, skill, name}: Props = $props();
|
||||
|
||||
const s: Readonly<Skill> = $derived.by(() => {
|
||||
const l = skill != null ? skills.global.filter((s) => s.skill_id === skill) : skills.global.filter((s) => s.name.includes(name!));
|
||||
if (name != null) {
|
||||
console.warn(`skills specified as ${name} (${hint}):`, l);
|
||||
}
|
||||
if (l.length === 0) {
|
||||
return ZERO_SKILL;
|
||||
}
|
||||
return l[0];
|
||||
});
|
||||
|
||||
const spanClass = $derived(mention ? 'italic' : 'font-bold')
|
||||
</script>
|
||||
|
||||
<span class={spanClass}>{s.name}</span>
|
||||
Reference in New Issue
Block a user