mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
29 lines
1014 B
Svelte
29 lines
1014 B
Svelte
<script lang="ts">
|
|
import { initCreateAttribute } from '$routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/+layout.svelte';
|
|
import { attributeOptions } from '$routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/attributes/store';
|
|
import Template from './template.svelte';
|
|
|
|
let search = '';
|
|
|
|
let options = attributeOptions.map((option) => {
|
|
return {
|
|
label: option.name,
|
|
icon: option.icon,
|
|
callback() {
|
|
initCreateAttribute(option.name);
|
|
}
|
|
};
|
|
});
|
|
|
|
$: filteredOptions = options.filter((option) => {
|
|
return option.label.toLowerCase().includes(search.toLowerCase());
|
|
});
|
|
</script>
|
|
|
|
<Template options={filteredOptions} bind:search>
|
|
<div class="u-flex u-cross-center u-gap-8" slot="option" let:option>
|
|
<i class="icon-{option.icon}"></i>
|
|
<span>{option.label}</span>
|
|
</div>
|
|
</Template>
|