fix(front): small things

This commit is contained in:
upsiflu 2025-03-25 11:05:37 +01:00
parent 0d743b7ca2
commit 5b8ca3c38e
2 changed files with 17 additions and 6 deletions

View File

@ -42,16 +42,12 @@ const styles = {
...widths, ...sizes
} as const satisfies Record<Key, string | ((w: string) => string)>
const getStyle = (props: Partial<WidthProps>) => (key: Key): string =>
// @ts-expect-error Typescript is hard
const getStyle = (props: Partial<WidthProps>) => (key: Key) =>
typeof styles[key] === 'function' && key in props
// @ts-expect-error Typescript is hard
? styles[key](
// TODO: Make the typescript compiler understand `key in props`
// @ts-expect-error Typescript is hard
// @ts-expect-error Typescript is hard. Make the typescript compiler understand `key in props`
props[key]
)
: styles[key]
// All keys are exclusive

View File

@ -0,0 +1,15 @@
import { computed, ref } from 'vue'
import { useStore } from '~/store'
/**
* Load and cache all tags
*
* @param current
*/
export const useTags = <T> (current = ref<string[]>([])) => {
const store = useStore()
const tags = computed(() => store.state.ui.tags)
}
// alternative ways to generate tags