2024-03-05 17:08:35 -06:00
|
|
|
<script lang="ts">
|
2024-04-26 06:18:19 +00:00
|
|
|
import RadioButton from '$lib/components/elements/radio-button.svelte';
|
2024-06-04 21:53:00 +02:00
|
|
|
import { t } from 'svelte-i18n';
|
2024-04-26 06:18:19 +00:00
|
|
|
|
2024-09-09 23:49:56 -04:00
|
|
|
export let query: string | undefined;
|
|
|
|
|
export let queryType: 'smart' | 'metadata' = 'smart';
|
2024-03-05 17:08:35 -06:00
|
|
|
</script>
|
|
|
|
|
|
2024-04-26 06:18:19 +00:00
|
|
|
<fieldset>
|
2024-06-04 21:53:00 +02:00
|
|
|
<legend class="immich-form-label">{$t('search_type')}</legend>
|
2024-04-26 06:18:19 +00:00
|
|
|
<div class="flex flex-wrap gap-x-5 gap-y-2 mt-1 mb-2">
|
2024-09-09 23:49:56 -04:00
|
|
|
<RadioButton name="query-type" id="context-radio" label={$t('context')} bind:group={queryType} value="smart" />
|
2024-04-26 06:18:19 +00:00
|
|
|
<RadioButton
|
|
|
|
|
name="query-type"
|
|
|
|
|
id="file-name-radio"
|
2024-06-04 21:53:00 +02:00
|
|
|
label={$t('file_name_or_extension')}
|
2024-09-09 23:49:56 -04:00
|
|
|
bind:group={queryType}
|
|
|
|
|
value="metadata"
|
2024-03-05 17:08:35 -06:00
|
|
|
/>
|
2024-04-26 06:18:19 +00:00
|
|
|
</div>
|
|
|
|
|
</fieldset>
|
2024-03-05 17:08:35 -06:00
|
|
|
|
2024-09-09 23:49:56 -04:00
|
|
|
{#if queryType === 'smart'}
|
2024-06-04 21:53:00 +02:00
|
|
|
<label for="context-input" class="immich-form-label">{$t('search_by_context')}</label>
|
2024-03-05 17:08:35 -06:00
|
|
|
<input
|
|
|
|
|
class="immich-form-input hover:cursor-text w-full !mt-1"
|
|
|
|
|
type="text"
|
2024-04-26 06:18:19 +00:00
|
|
|
id="context-input"
|
2024-03-05 17:08:35 -06:00
|
|
|
name="context"
|
2024-06-04 21:53:00 +02:00
|
|
|
placeholder={$t('sunrise_on_the_beach')}
|
2024-09-09 23:49:56 -04:00
|
|
|
bind:value={query}
|
2024-03-05 17:08:35 -06:00
|
|
|
/>
|
|
|
|
|
{:else}
|
2024-07-17 13:37:39 +02:00
|
|
|
<label for="file-name-input" class="immich-form-label">{$t('search_by_filename')}</label>
|
2024-03-05 17:08:35 -06:00
|
|
|
<input
|
|
|
|
|
class="immich-form-input hover:cursor-text w-full !mt-1"
|
|
|
|
|
type="text"
|
2024-04-26 06:18:19 +00:00
|
|
|
id="file-name-input"
|
2024-03-05 17:08:35 -06:00
|
|
|
name="file-name"
|
2024-07-17 13:37:39 +02:00
|
|
|
placeholder={$t('search_by_filename_example')}
|
2024-09-09 23:49:56 -04:00
|
|
|
bind:value={query}
|
2024-04-26 06:18:19 +00:00
|
|
|
aria-labelledby="file-name-label"
|
2024-03-05 17:08:35 -06:00
|
|
|
/>
|
|
|
|
|
{/if}
|