canina/frontend/application/components/EnamadBadge.tsx
parsa aghaei ea3bdf1ea3
Some checks failed
Deploy Canina / deploy (push) Failing after 29s
feat(enamad): dynamic enamad HTML embedding with exact code fallback & admin edit support
2026-08-08 18:12:42 +03:30

30 lines
1.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* eslint-disable @next/next/no-img-element */
'use client';
import React from 'react';
import { useSettingsStore } from '../lib/store/settingsStore';
const DEFAULT_ENAMAD_HTML = `<a referrerpolicy='origin' target='_blank' href='https://trustseal.enamad.ir/?id=765218&Code=dOdphRTqZwp3Kep5m07XwaqA0DTFh5ny'><img referrerpolicy='origin' src='https://trustseal.enamad.ir/logo.aspx?id=765218&Code=dOdphRTqZwp3Kep5m07XwaqA0DTFh5ny' alt='' style='cursor:pointer' code='dOdphRTqZwp3Kep5m07XwaqA0DTFh5ny'></a>`;
export default function EnamadBadge() {
const getText = useSettingsStore((state) => state.getText);
const enamadHtml = getText('ENAMAD_HTML_CODE', DEFAULT_ENAMAD_HTML);
return (
<div className="relative flex flex-col items-center justify-center p-6 bg-white/90 backdrop-blur-md rounded-2xl border border-gray-100 shadow-sm hover:shadow-md transition-all duration-300">
<div className="text-xs font-semibold text-teal-600 bg-teal-50 px-3 py-1 rounded-full mb-3">
نماد اعتماد الکترونیکی (eNamad)
</div>
<div
className="relative min-w-[120px] min-h-[120px] flex items-center justify-center bg-white rounded-xl overflow-hidden border border-gray-100 p-2"
dangerouslySetInnerHTML={{ __html: enamadHtml }}
/>
<p className="text-xs text-gray-500 mt-4 text-center leading-relaxed font-medium">
صادر شده توسط مرکز توسعه تجارت الکترونیکی (وزارت صمت)
</p>
</div>
);
}