Skip to content

Commit

Permalink
#4380 - Feature (Preview): Use MonomerWithIDTAliasesPreview
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriiP-EPAM committed May 8, 2024
1 parent ca6d8f9 commit 69220f4
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
***************************************************************************/
import MonomerWithIDTAliasesPreview from 'components/shared/MonomerWithIDTAliasesPreview';
import { useAppSelector } from 'hooks';
import { KetMonomerClass } from 'ketcher-core';
import { selectShowPreview } from 'state/common';
import NucleotidePreview from '../NucleotidePreview';
import MonomerPreview from '../MonomerPreview';
Expand All @@ -25,5 +27,16 @@ export const Preview = () => {
return <NucleotidePreview />;
}

const ketMonomerWithIDTAliasesClassSet = new Set<KetMonomerClass>([
KetMonomerClass.Base,
KetMonomerClass.CHEM,
KetMonomerClass.Phosphate,
KetMonomerClass.Sugar,
]);
const monomerClass = preview?.monomer?.props.MonomerClass;
if (ketMonomerWithIDTAliasesClassSet.has(monomerClass)) {
return <MonomerWithIDTAliasesPreview className="polymer-library-preview" />;
}

return <MonomerPreview className="polymer-library-preview" />;
};

0 comments on commit 69220f4

Please sign in to comment.