fix: Replace hardcoded SVGs in ChatInput with svelte-hero-icons components

This commit is contained in:
Shibo Lyu 2025-04-12 02:54:28 +08:00
parent a08122663e
commit d2c4b5aa47

View file

@ -5,6 +5,7 @@
import { proseMirrorDocToBlahRichText } from '$lib/richText'; import { proseMirrorDocToBlahRichText } from '$lib/richText';
import type { Node } from 'prosemirror-model'; import type { Node } from 'prosemirror-model';
import { messageSchema } from '$lib/components/RichTextInput/schema'; import { messageSchema } from '$lib/components/RichTextInput/schema';
import { Icon, PaperAirplane, PaperClip } from 'svelte-hero-icons';
let { let {
onSendMessage onSendMessage
@ -45,20 +46,7 @@
onsubmit={submit} onsubmit={submit}
> >
<Button class="p-1.5"> <Button class="p-1.5">
<svg <Icon src={PaperClip} solid class="size-5" />
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
class="size-5"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13"
/>
</svg>
<span class="sr-only">Attach</span> <span class="sr-only">Attach</span>
</Button> </Button>
<RichTextInput <RichTextInput
@ -71,16 +59,7 @@
onDocChange={(newDoc) => (doc = newDoc)} onDocChange={(newDoc) => (doc = newDoc)}
/> />
<Button class="p-1.5" variant="primary" type="submit"> <Button class="p-1.5" variant="primary" type="submit">
<svg <Icon src={PaperAirplane} solid class="z-10 size-5" />
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="currentColor"
class="z-10 size-5"
>
<path
d="M3.478 2.404a.75.75 0 0 0-.926.941l2.432 7.905H13.5a.75.75 0 0 1 0 1.5H4.984l-2.432 7.905a.75.75 0 0 0 .926.94 60.519 60.519 0 0 0 18.445-8.986.75.75 0 0 0 0-1.218A60.517 60.517 0 0 0 3.478 2.404Z"
/>
</svg>
<span class="sr-only">Send</span> <span class="sr-only">Send</span>
</Button> </Button>
</form> </form>