mirror of
https://github.com/Luchexx/wacrm.git
synced 2026-11-02 09:19:51 +00:00
refactor: update translation key types and simplify delete aria-label implementation
This commit is contained in:
parent
a6596de2c9
commit
c30e117552
@ -115,7 +115,7 @@ function fmtDate(iso: string): string {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function fmtExpiresIn(iso: string, t: (key: string, values?: Record<string, unknown>) => string): string {
|
function fmtExpiresIn(iso: string, t: (key: string, values?: Record<string, string | number>) => string): string {
|
||||||
const ms = new Date(iso).getTime() - Date.now();
|
const ms = new Date(iso).getTime() - Date.now();
|
||||||
if (ms <= 0) return t('expired');
|
if (ms <= 0) return t('expired');
|
||||||
const days = Math.floor(ms / (24 * 60 * 60 * 1000));
|
const days = Math.floor(ms / (24 * 60 * 60 * 1000));
|
||||||
|
|||||||
@ -188,7 +188,7 @@ export function TagManager() {
|
|||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => confirmDelete(tag)}
|
onClick={() => confirmDelete(tag)}
|
||||||
aria-label={t('deleteAria', { name: tag.name, bold: (chunks: React.ReactNode) => <strong>{chunks}</strong> })}
|
aria-label={t('deleteAria', { name: tag.name })}
|
||||||
className="ml-0.5 rounded-full p-0.5 opacity-60 transition-opacity hover:bg-black/10 hover:opacity-100 dark:hover:bg-white/10"
|
className="ml-0.5 rounded-full p-0.5 opacity-60 transition-opacity hover:bg-black/10 hover:opacity-100 dark:hover:bg-white/10"
|
||||||
>
|
>
|
||||||
<X className="size-3" />
|
<X className="size-3" />
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user