Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions src/lib/features/awesome-privacy/components/search.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -251,20 +251,34 @@
onclick={close}
class="flex w-full items-center gap-3 rounded-box px-3 py-2.5 text-left focus-within:bg-base-200 focus-within:outline-1 focus-within:outline-primary hover:bg-base-200"
>
<span class="shrink-0 text-base-content/40">
<span
class="flex size-6 shrink-0 items-center justify-center text-base-content/40 *:mr-1 [&>img]:size-6 [&>svg]:size-5"
>
{#if entry.type === 'service'}
<ServiceLogo service={{ ...entry.meta } as Service} class="size-6" />
<ServiceLogo service={{ ...entry.meta } as Service} />
{:else if entry.type === 'category'}
<CategoryIcon category={entry.name} class="size-5" />
<CategoryIcon category={entry.name} />
{:else}
<Icons.section class="size-5" />
<Icons.section />
{/if}
</span>

<span class="min-w-0 flex-1">
<Text class="truncate font-medium text-base-content">{entry.name}</Text>
{#if entry.description}
<Text size="xs" class="truncate">{entry.description}</Text>
<Text size="xs" class="line-clamp-3 sm:line-clamp-1">{entry.description}</Text
>
{/if}

{#if entry?.meta?.parent}
{@const parents = entry.meta.parent.split(',')}
<div class="mt-1 flex flex-wrap items-center gap-1">
{#each parents as parent, index (index)}
<span class="badge badge-soft badge-xs">
{parent}
</span>
{/each}
</div>
{/if}
</span>

Expand Down
4 changes: 4 additions & 0 deletions src/lib/features/awesome-privacy/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ export class AwesomePrivacy {

entries.push({
type: 'section',
meta: {
parent: category.name
},
name: section.name,
description: section.intro,
categorySlug,
Expand All @@ -145,6 +148,7 @@ export class AwesomePrivacy {
name: service.name,
description: service.description,
meta: {
parent: `${category.name},${section.name}`,
url: service.url,
icon: service.icon
},
Expand Down
1 change: 1 addition & 0 deletions src/lib/features/awesome-privacy/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export type SearchEntry = {
type: SearchEntryType;
name: string;
meta?: {
parent?: string;
url?: string;
icon?: string;
};
Expand Down
Loading