Skip to content

Commit 29379b5

Browse files
author
MMelchor
committed
wip
1 parent 14e36c3 commit 29379b5

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<template>
2+
<div id="torrent-comment" class="flex flex-col gap-6">
3+
<div class="flex flex-row items-center justify-between">
4+
<h2 class="mr-1 text-2xl font-medium text-left text-neutral-content/50">
5+
Comment
6+
</h2>
7+
<button
8+
class="flex flex-col items-center justify-center w-10 h-10 duration-200 bg-transparent text-base-content/50 hover:text-base-content rounded-xl"
9+
@click="collapsed = !collapsed"
10+
>
11+
<ChevronDownIcon class="w-6" :class="{ 'rotate-90': collapsed }" />
12+
</button>
13+
</div>
14+
<template v-if="!collapsed">
15+
<div class="flex flex-col w-full h-full p-6 grow bg-base-100 rounded-2xl">
16+
<template v-if="torrent.comment">
17+
<Markdown :source="torrent.comment" />
18+
</template>
19+
<template v-else>
20+
<span class="italic text-neutral-content">No comment provided.</span>
21+
</template>
22+
</div>
23+
</template>
24+
</div>
25+
</template>
26+
27+
<script setup lang="ts">
28+
import { ChevronDownIcon } from "@heroicons/vue/24/solid";
29+
import { TorrentResponse } from "torrust-index-types-lib";
30+
import { PropType } from "vue";
31+
import { ref } from "#imports";
32+
import Markdown from "~/components/Markdown.vue";
33+
34+
const collapsed = ref(false);
35+
36+
const props = defineProps({
37+
torrent: {
38+
type: Object as PropType<TorrentResponse>,
39+
required: true
40+
}
41+
});
42+
</script>
43+
44+
<style scoped>
45+
46+
</style>

components/torrent/TorrentDetails.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
</div>
1717
<div v-if="torrent" class="flex flex-col flex-auto w-full gap-6">
1818
<TorrentDescriptionTab :torrent="torrent" @updated="reloadTorrent" />
19+
<TorrentCommentTab :torrent="torrent" @updated="reloadTorrent" />
1920
<TorrentFilesTab :torrent="torrent" @updated="reloadTorrent" />
2021
<TorrentTrackersTab :torrent="torrent" @updated="reloadTorrent" />
2122
</div>

0 commit comments

Comments
 (0)