feat: Add profile editor

This commit is contained in:
Jesse Wierzbinski 2024-12-07 17:19:41 +01:00
parent 8626a15076
commit 48196026ee
No known key found for this signature in database
6 changed files with 377 additions and 8 deletions

View file

@ -1,19 +1,26 @@
<script lang="ts" setup>
import { cn } from "@/lib/utils";
import { useId } from "radix-vue";
import { Primitive, type PrimitiveProps, useId } from "radix-vue";
import { type HTMLAttributes, provide } from "vue";
import { FORM_ITEM_INJECTION_KEY } from "./injectionKeys";
const props = defineProps<{
class?: HTMLAttributes["class"];
}>();
const props = withDefaults(
defineProps<
PrimitiveProps & {
class?: HTMLAttributes["class"];
}
>(),
{
as: "div",
},
);
const id = useId();
provide(FORM_ITEM_INJECTION_KEY, id);
</script>
<template>
<div :class="cn('space-y-2', props.class)">
<slot />
</div>
<Primitive :as="props.as" :as-child="props.asChild" :class="cn('space-y-2', props.class)">
<slot />
</Primitive>
</template>