namespace Houston.Model.Documents;
public readonly record struct DocumentName(string Value)
{
public bool Matches(string pattern)
{
return Value.Contains(pattern, StringComparison.CurrentCultureIgnoreCase);
}
///
/// Whether this document is a PDF and therefore eligible for the inline modal preview.
///
public bool IsPdf => Value.EndsWith(".pdf", StringComparison.OrdinalIgnoreCase);
///
/// Whether this is an external document link (a .URL file).
///
public bool IsLink => Value.EndsWith(".url", StringComparison.OrdinalIgnoreCase);
///
/// File display name.
///
public string DisplayName => IsLink ? Value[..^".url".Length] : Value;
///
public override string ToString() => Value;
}