1
0
mirror of https://github.com/MisskeyIO/misskey synced 2024-12-23 02:58:18 +09:00
MisskeyIO/packages/frontend/src/components/MkFileCaptionEditWindow.vue

54 lines
1.3 KiB
Vue
Raw Normal View History

<!--
SPDX-FileCopyrightText: syuilo and other misskey contributors
SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
2023-01-06 09:41:14 +09:00
<MkModalWindow
ref="dialog"
:width="400"
:height="450"
2023-05-19 13:58:09 +09:00
:withOkButton="true"
:okButtonDisabled="false"
@ok="ok()"
@close="dialog.close()"
@closed="emit('closed')"
>
<template #header>{{ i18n.ts.describeFile }}</template>
2023-05-19 13:58:09 +09:00
<MkSpacer :marginMin="20" :marginMax="28">
2022-12-29 17:26:10 +09:00
<MkDriveFileThumbnail :file="file" fit="contain" style="height: 100px; margin-bottom: 16px;"/>
<MkTextarea v-model="caption" autofocus :placeholder="i18n.ts.inputNewDescription">
<template #label>{{ i18n.ts.caption }}</template>
</MkTextarea>
2022-12-29 17:26:10 +09:00
</MkSpacer>
2023-01-06 09:41:14 +09:00
</MkModalWindow>
</template>
<script lang="ts" setup>
import { } from 'vue';
import * as Misskey from 'misskey-js';
2023-01-06 09:41:14 +09:00
import MkModalWindow from '@/components/MkModalWindow.vue';
2023-01-07 15:09:46 +09:00
import MkTextarea from '@/components/MkTextarea.vue';
import MkDriveFileThumbnail from '@/components/MkDriveFileThumbnail.vue';
2023-09-19 16:37:43 +09:00
import { i18n } from '@/i18n.js';
const props = defineProps<{
file: Misskey.entities.DriveFile;
default: string;
}>();
const emit = defineEmits<{
(ev: 'done', v: string): void;
(ev: 'closed'): void;
}>();
2023-01-06 09:41:14 +09:00
const dialog = $shallowRef<InstanceType<typeof MkModalWindow>>();
let caption = $ref(props.default);
async function ok() {
emit('done', caption);
dialog.close();
}
</script>