mirror of
https://github.com/versia-pub/frontend.git
synced 2026-01-26 04:16:02 +01:00
40 lines
1.1 KiB
Vue
40 lines
1.1 KiB
Vue
<template>
|
|
<Select v-model:model-value="visibility">
|
|
<SelectTrigger as-child disable-default-classes disable-select-icon>
|
|
<slot/>
|
|
</SelectTrigger>
|
|
<SelectContent>
|
|
<SelectItem
|
|
v-for="(v, k) in visibilities"
|
|
:key="k"
|
|
@click="visibility = k"
|
|
:value="k"
|
|
>
|
|
<div
|
|
class="flex flex-row gap-3 items-center w-full justify-between"
|
|
>
|
|
<component :is="v.icon" class="size-4"/>
|
|
<div class="flex flex-col gap-1">
|
|
<span class="font-semibold">{{ v.name }}</span>
|
|
<span>{{ v.text }}</span>
|
|
</div>
|
|
</div>
|
|
</SelectItem>
|
|
</SelectContent>
|
|
</Select>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import {
|
|
Select,
|
|
SelectContent,
|
|
SelectItem,
|
|
SelectTrigger,
|
|
} from "~/components/ui/select";
|
|
import { visibilities } from "./visibilities";
|
|
|
|
const visibility = defineModel<ComposerState["visibility"]>("visibility", {
|
|
required: true,
|
|
});
|
|
</script>
|