This repository has been archived on 2026-04-20. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
chrom-tool/src/components/browser-data/BookmarksList.vue
2026-04-16 17:50:33 -04:00

121 lines
2.7 KiB
Vue

<script setup lang="ts">
import SortDropdown from "../SortDropdown.vue";
import type { BookmarkSortKey, BookmarkSummary } from "../../types/browser";
defineProps<{
bookmarks: BookmarkSummary[];
sortKey: BookmarkSortKey;
domainFromUrl: (url: string) => string;
}>();
const emit = defineEmits<{
"update:sortKey": [value: BookmarkSortKey];
showProfiles: [url: string];
}>();
</script>
<template>
<section class="content-section">
<div class="sort-bar">
<SortDropdown
:model-value="sortKey"
label="Sort by"
:options="[
{ label: 'Name', value: 'title' },
{ label: 'URL', value: 'url' },
]"
@update:model-value="emit('update:sortKey', $event as BookmarkSortKey)"
/>
</div>
<div v-if="bookmarks.length" class="bookmark-list">
<article v-for="bookmark in bookmarks" :key="bookmark.url" class="bookmark-card">
<div class="bookmark-body">
<div class="bookmark-topline">
<h4>{{ bookmark.title }}</h4>
<span class="badge neutral">{{ domainFromUrl(bookmark.url) }}</span>
</div>
<p class="bookmark-url" :title="bookmark.url">{{ bookmark.url }}</p>
<div class="source-disclosure">
<button
class="disclosure-button"
type="button"
@click="emit('showProfiles', bookmark.url)"
>
<span>View Profiles</span>
<span class="badge neutral">{{ bookmark.profileIds.length }}</span>
</button>
</div>
</div>
</article>
</div>
<div v-else class="empty-card">
<p>No bookmarks were discovered for this browser.</p>
</div>
</section>
</template>
<style scoped>
.bookmark-card {
display: flex;
gap: 12px;
border-radius: 18px;
padding: 14px;
border: 1px solid rgba(148, 163, 184, 0.18);
background: var(--panel-strong);
}
.bookmark-body {
min-width: 0;
flex: 1;
}
.bookmark-topline {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 12px;
}
.bookmark-topline h4 {
margin: 0;
font-size: 0.96rem;
line-height: 1.35;
font-weight: 600;
letter-spacing: -0.03em;
}
.bookmark-url {
margin: 6px 0 0;
color: var(--muted);
font-size: 0.87rem;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.source-disclosure {
margin-top: 10px;
}
.disclosure-button {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
width: fit-content;
min-width: 120px;
padding: 7px 10px;
border-radius: 12px;
background: rgba(241, 245, 249, 0.9);
color: var(--badge-text);
cursor: pointer;
}
@media (max-width: 720px) {
.bookmark-card {
flex-direction: column;
}
}
</style>