|
|
@@ -4,11 +4,11 @@ import { useTranslation } from 'next-i18next';
|
|
|
|
|
|
import { useCurrentPagePath } from '~/stores/page';
|
|
|
|
|
|
-type SearchButtonProps = {
|
|
|
+type MenuItemProps = {
|
|
|
children: React.ReactNode
|
|
|
onClick: () => void
|
|
|
}
|
|
|
-const SearchButton = (props: SearchButtonProps): JSX.Element => {
|
|
|
+const MenuItem = (props: MenuItemProps): JSX.Element => {
|
|
|
const { children, onClick } = props;
|
|
|
|
|
|
return (
|
|
|
@@ -22,10 +22,10 @@ const SearchButton = (props: SearchButtonProps): JSX.Element => {
|
|
|
};
|
|
|
|
|
|
|
|
|
-type SearchButtonsProps = {
|
|
|
+type SearchMethodMenuItemProps = {
|
|
|
searchKeyword: string
|
|
|
}
|
|
|
-export const SearchButtons = (props: SearchButtonsProps): JSX.Element => {
|
|
|
+export const SearchMethodMenuItem = (props: SearchMethodMenuItemProps): JSX.Element => {
|
|
|
const { t } = useTranslation('commons');
|
|
|
|
|
|
const { data: currentPagePath } = useCurrentPagePath();
|
|
|
@@ -38,29 +38,29 @@ export const SearchButtons = (props: SearchButtonsProps): JSX.Element => {
|
|
|
<table className="table">
|
|
|
<tbody>
|
|
|
{ shouldShowButton && (
|
|
|
- <SearchButton onClick={() => {}}>
|
|
|
+ <MenuItem onClick={() => {}}>
|
|
|
<span>{searchKeyword}</span>
|
|
|
<div className="ms-auto">
|
|
|
<span>{t('search_buttons.search_in_all')}</span>
|
|
|
</div>
|
|
|
- </SearchButton>
|
|
|
+ </MenuItem>
|
|
|
)}
|
|
|
|
|
|
- <SearchButton onClick={() => {}}>
|
|
|
+ <MenuItem onClick={() => {}}>
|
|
|
<code>prefix: {currentPagePath}</code>
|
|
|
<span className="ms-2">{searchKeyword}</span>
|
|
|
<div className="ms-auto">
|
|
|
<span>{t('search_buttons.only_children_of_this_tree')}</span>
|
|
|
</div>
|
|
|
- </SearchButton>
|
|
|
+ </MenuItem>
|
|
|
|
|
|
{ shouldShowButton && (
|
|
|
- <SearchButton onClick={() => {}}>
|
|
|
+ <MenuItem onClick={() => {}}>
|
|
|
<span>{`"${searchKeyword}"`}</span>
|
|
|
<div className="ms-auto">
|
|
|
<span>{t('search_buttons.exact_mutch')}</span>
|
|
|
</div>
|
|
|
- </SearchButton>
|
|
|
+ </MenuItem>
|
|
|
) }
|
|
|
</tbody>
|
|
|
</table>
|