mirror of
https://github.com/mark3labs/kit.git
synced 2026-06-13 19:20:06 +00:00
chore(ui): remove dead toast and clipboard code
Remove 8 unused exports from clipboard package: - CopyToClipboardWithMessage, IsClipboardSupported - ToastMsg, ToastType, ToastInfo, ToastSuccess, ToastWarning, ToastError These were remnants of a toast notification feature that was never wired up. No callers exist anywhere in the codebase.
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
package clipboard
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
|
||||
tea "charm.land/bubbletea/v2"
|
||||
"github.com/atotto/clipboard"
|
||||
)
|
||||
@@ -26,45 +24,3 @@ func CopyToClipboard(text string) tea.Cmd {
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
// CopyToClipboardWithMessage writes text to clipboard and returns a toast notification.
|
||||
func CopyToClipboardWithMessage(text string, message string) tea.Cmd {
|
||||
if text == "" {
|
||||
return nil
|
||||
}
|
||||
|
||||
return tea.Sequence(
|
||||
CopyToClipboard(text),
|
||||
func() tea.Msg {
|
||||
return ToastMsg{Message: message, Type: ToastInfo}
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
// ToastType represents the type of toast notification.
|
||||
type ToastType int
|
||||
|
||||
const (
|
||||
ToastInfo ToastType = iota
|
||||
ToastSuccess
|
||||
ToastWarning
|
||||
ToastError
|
||||
)
|
||||
|
||||
// ToastMsg is a message to display a toast notification.
|
||||
type ToastMsg struct {
|
||||
Message string
|
||||
Type ToastType
|
||||
}
|
||||
|
||||
// IsClipboardSupported returns true if the clipboard is supported on this platform.
|
||||
func IsClipboardSupported() bool {
|
||||
switch runtime.GOOS {
|
||||
case "darwin", "windows":
|
||||
return true
|
||||
case "linux":
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user