Files
CodeNomad/packages/ui/src/components/attachment-chip.tsx
Shantur Rathore 5b1e21345f feat(ui): localize UI strings
Converts hardcoded UI copy to i18n keys across the app, adds global translation for non-component modules, and splits the English catalog into feature modules with duplicate-key detection.
2026-01-26 12:26:12 +00:00

30 lines
745 B
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.

import { Component } from "solid-js"
import type { Attachment } from "../types/attachment"
import { useI18n } from "../lib/i18n"
interface AttachmentChipProps {
attachment: Attachment
onRemove: () => void
}
const AttachmentChip: Component<AttachmentChipProps> = (props) => {
const { t } = useI18n()
return (
<div
class="attachment-chip"
title={props.attachment.source.type === "file" ? props.attachment.source.path : undefined}
>
<span class="font-mono">{props.attachment.display}</span>
<button
onClick={props.onRemove}
class="attachment-remove"
aria-label={t("attachmentChip.removeAriaLabel")}
>
×
</button>
</div>
)
}
export default AttachmentChip