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