|
@@ -2,39 +2,55 @@ import React from 'react';
|
|
|
|
|
|
|
|
import { useTranslation } from 'next-i18next';
|
|
import { useTranslation } from 'next-i18next';
|
|
|
|
|
|
|
|
-export const SearchButtons = (): JSX.Element => {
|
|
|
|
|
|
|
+type Props = {
|
|
|
|
|
+ searchText: string
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+export const SearchButtons = (props: Props): JSX.Element => {
|
|
|
const { t } = useTranslation('commons');
|
|
const { t } = useTranslation('commons');
|
|
|
|
|
+ const { searchText } = props;
|
|
|
|
|
+
|
|
|
|
|
+ const shouldShowButton = searchText.length > 0;
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
<table className="table">
|
|
<table className="table">
|
|
|
<tbody>
|
|
<tbody>
|
|
|
- <tr>
|
|
|
|
|
- <div className="text-muted ps-1 d-flex">
|
|
|
|
|
- <span className="material-symbols-outlined fs-4 me-3">search</span>
|
|
|
|
|
- <div className="ms-auto">
|
|
|
|
|
- <span>Search in all</span>
|
|
|
|
|
|
|
+
|
|
|
|
|
+ { shouldShowButton && (
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <div className="text-muted ps-1 d-flex">
|
|
|
|
|
+ <span className="material-symbols-outlined fs-4 me-3">search</span>
|
|
|
|
|
+ <span>{searchText}</span>
|
|
|
|
|
+ <div className="ms-auto">
|
|
|
|
|
+ <span>Search in all</span>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
- </tr>
|
|
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ )}
|
|
|
|
|
|
|
|
<tr>
|
|
<tr>
|
|
|
<div className="text-muted ps-1 d-flex">
|
|
<div className="text-muted ps-1 d-flex">
|
|
|
<span className="material-symbols-outlined fs-4 me-3">search</span>
|
|
<span className="material-symbols-outlined fs-4 me-3">search</span>
|
|
|
<code>~pagehoge/</code>
|
|
<code>~pagehoge/</code>
|
|
|
|
|
+ <span className="ms-2">{searchText}</span>
|
|
|
<div className="ms-auto">
|
|
<div className="ms-auto">
|
|
|
<span>{t('header_search_box.item_label.This tree')}</span>
|
|
<span>{t('header_search_box.item_label.This tree')}</span>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</tr>
|
|
</tr>
|
|
|
|
|
|
|
|
- <tr>
|
|
|
|
|
- <div className="text-muted ps-1 d-flex">
|
|
|
|
|
- <span className="material-symbols-outlined fs-4 me-3">search</span>
|
|
|
|
|
- <div className="ms-auto">
|
|
|
|
|
- <span>Exact match</span>
|
|
|
|
|
|
|
+ { shouldShowButton && (
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <div className="text-muted ps-1 d-flex">
|
|
|
|
|
+ <span className="material-symbols-outlined fs-4 me-3">search</span>
|
|
|
|
|
+ <span>{`"${searchText}"`}</span>
|
|
|
|
|
+ <div className="ms-auto">
|
|
|
|
|
+ <span>Exact match</span>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
- </tr>
|
|
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ ) }
|
|
|
|
|
+
|
|
|
</tbody>
|
|
</tbody>
|
|
|
</table>
|
|
</table>
|
|
|
);
|
|
);
|