* feat: add improved search * wip: add support for sorting, rename use-options to use-query-options, add use-options for local usage, add pages search group * feat: add help links from manage layout to help search mode * feat: add additional search engines * feat: add group search details * refactor: improve users search group type * feat: add apps search group, add disabled search interaction * feat: add integrations and boards for search * wip: hook issue with react * fix: hook issue regarding actions and interactions * chore: address pull request feedback * fix: format issues * feat: add additional global actions to search * chore: remove unused code * fix: search engine short key * fix: typecheck issues * fix: deepsource issues * fix: eslint issue * fix: lint issues * fix: unordered dependencies * chore: address pull request feedback
39 lines
930 B
TypeScript
39 lines
930 B
TypeScript
"use client";
|
|
|
|
import { TextInput, UnstyledButton } from "@mantine/core";
|
|
import { IconSearch } from "@tabler/icons-react";
|
|
|
|
import { openSpotlight } from "@homarr/spotlight";
|
|
import { useI18n } from "@homarr/translation/client";
|
|
|
|
import { HeaderButton } from "./button";
|
|
import classes from "./search.module.css";
|
|
|
|
export const DesktopSearchInput = () => {
|
|
const t = useI18n();
|
|
|
|
return (
|
|
<TextInput
|
|
component={UnstyledButton}
|
|
className={classes.desktopSearch}
|
|
w={400}
|
|
size="sm"
|
|
leftSection={<IconSearch size={20} stroke={1.5} />}
|
|
onClick={openSpotlight}
|
|
>
|
|
{t("common.rtl", {
|
|
value: t("search.placeholder"),
|
|
symbol: "...",
|
|
})}
|
|
</TextInput>
|
|
);
|
|
};
|
|
|
|
export const MobileSearchButton = () => {
|
|
return (
|
|
<HeaderButton onClick={openSpotlight} className={classes.mobileSearch}>
|
|
<IconSearch size={20} stroke={1.5} />
|
|
</HeaderButton>
|
|
);
|
|
};
|