RemoveButton.svelte 514 B

1234567891011121314151617181920212223242526
  1. <script lang="ts">
  2. import { X } from '@lucide/svelte';
  3. import { Button } from '$lib/components/ui/button';
  4. interface Props {
  5. id: string;
  6. onRemove?: (id: string) => void;
  7. class?: string;
  8. }
  9. let { id, onRemove, class: className = '' }: Props = $props();
  10. </script>
  11. <Button
  12. type="button"
  13. variant="ghost"
  14. size="sm"
  15. class="h-6 w-6 bg-white/20 p-0 hover:bg-white/30 {className}"
  16. onclick={(e) => {
  17. e.stopPropagation();
  18. onRemove?.(id);
  19. }}
  20. aria-label="Remove file"
  21. >
  22. <X class="h-3 w-3" />
  23. </Button>